Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
sivakrishna
Contributor II
Contributor II

To create day field from corona data if cases start for every country by date

Hi,

I am new one to qlik, i am practicing by using Corona data 

Here i would like to do derive new field which is day when cases start and it increment one for every day by date for each country field in back-end.

Please let me know the answer

Labels (1)
2 Solutions

Accepted Solutions
msKarthikeyan
Employee
Employee

Hi Siva Krishna,

For a data set like this.

corona:
load * Inline [
Country, date, count
India,01/01/2020,1
India,01/02/2020,2
India,01/03/2020,3
India,01/05/2020,5
India,01/06/2020,7
India,01/07/2020,1
India,01/08/2020,1
India,01/09/2020,1

Singapore,01/11/2020,3
Singapore,01/12/2020,4
Singapore,01/13/2020,1
Singapore,01/14/2020,5
Singapore,01/15/2020,1
Singapore,01/16/2020,2
Singapore,01/18/2020,1

];

 

You can use following expressions. 

date- aggr(nodistinct min(date),Country)  --> days Since

rangesum(above(sum(count),0,rowno())) --> Running Total 

 

-Karthik 

View solution in original post

lorenzoconforti
Specialist II
Specialist II

I would implement it on the visualisation side as a calculated dimension. See attached; you can modify the number of cases with the slider and then the table will update accordingly giving you the required increments (and also filtering the table itself so that it's ready for visualisations)

See below and attached

Covid.png

View solution in original post

2 Replies
msKarthikeyan
Employee
Employee

Hi Siva Krishna,

For a data set like this.

corona:
load * Inline [
Country, date, count
India,01/01/2020,1
India,01/02/2020,2
India,01/03/2020,3
India,01/05/2020,5
India,01/06/2020,7
India,01/07/2020,1
India,01/08/2020,1
India,01/09/2020,1

Singapore,01/11/2020,3
Singapore,01/12/2020,4
Singapore,01/13/2020,1
Singapore,01/14/2020,5
Singapore,01/15/2020,1
Singapore,01/16/2020,2
Singapore,01/18/2020,1

];

 

You can use following expressions. 

date- aggr(nodistinct min(date),Country)  --> days Since

rangesum(above(sum(count),0,rowno())) --> Running Total 

 

-Karthik 

lorenzoconforti
Specialist II
Specialist II

I would implement it on the visualisation side as a calculated dimension. See attached; you can modify the number of cases with the slider and then the table will update accordingly giving you the required increments (and also filtering the table itself so that it's ready for visualisations)

See below and attached

Covid.png