Compare evolution of column value by day

Hi!

I have a simple dataset in which each row corresponds to the data of one specific day.
I want to create a KPI that shows me the comparison of the values of one column between the latest date the table contains and the day before.

Here is an illustration of my dataset:

I want to create a KPI that shows me the daily evolution. In this case, the KPI should output the value ‘0’.

This is probably a very easy question, but I cannot implement this.

Hi jcatulo,
I am assuming you need to find a difference between two values based on a date column. Have our tried Quicksight lag function to get the previous value? if not, you may create a calculated field using lag function to get the previous value based on date as sort key and then subtract it from the current value to get the difference. Hope this helps.
Thank you

2 Likes

I was not able to get the lag function to work.

I also tried the following:

periodOverPeriodDifference(sum({column}),date, DAY, offset)

This gives me the difference I want. However, I can only create a Table showing the values. I want a KPI that shows the value corresponding to the corrente date.

Here is an illustration:

I want to show in a KPI the value circled in red. How can I do that?

1 Like

Hi @jcatulo ,

You can accomplish this by doing the following.

  • Add a new visual.
  • Set the visual type to be KPI (See image below) from left panel.
  • Add the date and measure fields from field list.
  • Open the field well and ensure that the aggregate is set to day grain (default).

The KPI visual will display the difference between last two most recent entries.

Regards,
Arun Santhosh