Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
saurabhk18
Contributor II
Contributor II

Calculating monthly % change when month is a dimension

I'm sorry I couldn't think of a better title.

I'm working on Qlikview 11.2 and have only four months' experience working on it. Here is my scenario:

I have a data set, a sample of which looks like this (Dec-17 indicates Dec 2017):

  

SourceDateSeries IDIndex Value
ADec-17A101100
AJan-18A101101
AFeb-18A10199

There are many such sources (column 1) each of which has multiple series IDs (column 3). The value of these series IDs (last column) is tracked over time. I have a requirement to track the monthly % change ((value in current month - value in previous month)/value in previous month) * 100. Here is a sample of the expected result:

   

SourceSeries IDDec-17Jan-17Feb-17
AA10101-2

The date, as usual, is a dimension. How do I write the expression such that it picks up the month in the column header to get the current month and subtracts one month from it to get the previous month?

Note: Source, Series ID and Date are dimensions, but I've tabulated them together for ease of understanding.

Thanks in advance!

-Saurabh

3 Replies
shiveshsingh
Master
Master

May be this?

saurabhk18
Contributor II
Contributor II
Author

Hi Shivesh,

Thanks for your answer. The data I shared was just a sample. There are multiple sources, each of which has multiple series IDs. And we have index values for each series ID since 2014 (so the months will be Jan-14, Feb-14...Mar-18).

Also, I would like to show the data as a pivot table with Source, Series ID and Date as dimensions. The expression will be ((value in current month - value in previous month)/value in previous month) * 100, like the second table I shared:


SourceSeries IDDec-17Jan-17Feb-17
AA10101-2


Do you have a solution for this without creating column(1) and column(2) (as you've done in your code) ?


Thanks,

Saurabh

shiveshsingh
Master
Master

Hi


Let me check