Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am trying to get data on a daily level but I am not able to as I have raw data in cumulative format.
PLS find data for your reference. In this data, I am getting confirmed cases for a date but it is cumulative in nature, I would like to get my data in such a way that when I select the date as 02-05-2021 it will give me covid cases for that specific date only, For example, if I select data from the filter is 02-05-2021 then confirmed cases will be a number of cases on 02-05-2021 subtracted number of cases on the previous date which is 01-05-2021.
if I select data from the filter as 02-05-2021 then the output will be 655997-652368 equals 3629
Pls help me to write the logic for the same
Date | State | District | Confirmed |
01-05-2021 | Maharashtra | Mumbai | 652368 |
02-05-2021 | Maharashtra | Mumbai | 655997 |
03-05-2021 | Maharashtra | Mumbai | 658621 |
04-05-2021 | Maharashtra | Mumbai | 661175 |
05-05-2021 | Maharashtra | Mumbai | 665057 |
06-05-2021 | Maharashtra | Mumbai | 668085 |
Please try this in you script-
Add these 2 below lines in your Load statement
1) RowNo() as Row
2)IF(RowNo() = 1,Confirmed, (Confirmed - peek(Confirmed,-1))) as Actual
and after reloading add sum(Actual) in your expression
Hope this helps you!
Thanks,
Saloni
Please try this in you script-
Add these 2 below lines in your Load statement
1) RowNo() as Row
2)IF(RowNo() = 1,Confirmed, (Confirmed - peek(Confirmed,-1))) as Actual
and after reloading add sum(Actual) in your expression
Hope this helps you!
Thanks,
Saloni
Thanks a lot for your help.
Best,
Vishav Bhatia