# How do I represent the age/staleness of composite data?

A system has a quantity that is the product of two others: `C = A * B`

Imagine `A` is an amount in Euro, `B` is the exchange rate to USD/EUR and `C` is the equivalent amount in USD.

Now, the values of A and B also have a timestamp, when were they refreshed last.

`A` might have been updated 3 days ago, and `B` a month ago.

1. How do I define the "staleness" of `C`?
2. Is it better to show a timestamp or some sort of fuzzy indicator?
• C=A*B that means, the updated value of C is directly proportional to the values of A & B, which means, you can use the most updated timestamp value among A&B and use it for C as well Aug 24, 2020 at 9:13
• Well, how do you even know that C is stale in the first place? Even if B was only updated one month ago, how do you know that isn't the most recent exchange rate available? I think your first problem is not knowing when something was last updated, but knowing if it is that latest data or not. Aug 24, 2020 at 9:52
• @musefan assume there are tables with data points for `A` and `B`, with their respective timestamps. So, if it's financial data we can assume that the freshest would be of today but for some reason those data points are not in the table yet. I would like to render `C` and convey the notion that it's the product of stale data to different degrees, e.g. the amount in Euro could be a month old, and the exchange rate a week old. How old would the amount converted to USD, and how do I convey it ?
– Dan
Aug 24, 2020 at 20:08
• How about adding a text below the C value where it says "Last updated: XX minutes/hours/days ago" Aug 25, 2020 at 6:18
• @SoorajMV but which date I use: A's, B's or a combination? or maybe just map it to a scale of green-yellow-red ?
– Dan
Aug 25, 2020 at 7:59

## Defining Staleness

As a product of how old A and B are.

For example, if A is 3 days old, and B is 5 days old, then staleness = 15. The freshest score is 1 - when both A and B were updated today.

While not perfect, this allows you to factor in the impact of multiplying a "fresh" datum with a "stale" one - which still produces a "stale result".

## Displaying Staleness

I suggest controlling opacity based on staleness, so that older values appear more faded.

For example,

• 100% opacity for staleness score = 1
• 40% opacity for score => a threshold value such as 30.
• Staleness scores from 2 to 29 interpolated linearly in this range.

Let's analyze data which you have. `B` is exchange rate and it updates once a day in your application scope (for example). It might not change but should be updated each day to be actual.

So, if your timestamp for exchange rate means that it wasn't changed from that time you can count its real date as today. But if you are not sure that this is actual rate it makes sense only as historical data. Do you need to know that amount `A` (regardless when it was input) somewhen in past had USD value `C`? Is this what your business requires then you should use timestamp of exchange rate. More likely your business need actual information, so having obsolete exchange rate value should mark `C` as unreliable data and in this case it makes no sense to use it at all because it could lead to problems due to incorrect calculations (accounting, taxes, etc.).

Here's what Apple does in the macOS Calculator app: the form simply displays a "last updated" date. If the exchange rate is "stale," the text appears in red to catch the user's eye.

Since it's in immediate vicinity to the interactions for triggering the operation, it's clear enough whether the result of that conversation'd be stale, too.

• thanks @JochenW but in this case, one of the variables is entered immediately, i.e. is guaranteed fresh. My question relates more to the representation of staleness when you have two variables that contribute to the result and each can have its own degree of staleness.
– Dan
Aug 28, 2020 at 5:22