Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Cumulative data

Is there anyone how can help me with this issue?

I have the following camulative data:

Year     Month     Fact

2011     1               100

2011     2               150

2011     3               300

2012     1               80

2012     2               120

2012     3               200

For each year I want to calculate in my script the difference between the month's.

So the following data is what I need:

Year     Month     Fact

2011     1               100

2011     2               50

2011     3               150

2012     1               80

2012     2               40

2012     3               80

What script/function must I use to get the data between the month's for each year separate?

1 Reply
jonathandienst

Hi

Something like this:

LOAD Year,

          Month

          Amount

          Amount - Alt(Previous(Amount), 0) As Difference,

          ...

FROM SourceTable

ORDER By Year, Month

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein