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

Month minus previous month

Hi,

first post so be gentle please

I have a data structure with numerous lines which I sum up against a calendar day/week/month as required..

Now in one specific chart I have the sums per month for all history.. I would like to have another column with the delta of X against month X-1 .

I have the previous month in as a value in the table structure, created with date((MonthStart)-1, 'MM/YYYY')

but how do I get the previous months numbers to display in the current months row..

thank you

1 Solution

Accepted Solutions
Not applicable
Author

Okay.  Try this instead of your range expression

count(Amount)-Above(Count(Amount))

This will populate the cells when you add Category.  You will then want to sort the chart so the expression works the way you need it.  For example, if you need the change for each product over time, sort by product - text A->Z

View solution in original post

6 Replies
Not applicable
Author

OK.. I have found the range sum and got this working...

next, I have only have 1 dimension..

how can I have 2 or 3 dimension??

Not applicable
Author

Try a master calender with a AsOfMonth field

f.e. a AsOfYear Table

Kalender:
LOAD * INLINE "

Year, AsOfYear, Periodtype
2000, 2000, Current
2001, 2001, Current
2001, 2000, Previous
2002, 2001, Previous

"

Not applicable
Author

Hi Chris,

Can you share an example QVW?  I'm not sure I understand your requirements

Not applicable
Author

OK.

I have a chart, Dimension = YearMonth and expression = count(Amount)

next I wanted to add another expression to calculate the difference between each month and the month previous.

I think I can do this with the expression...

count(Amount) - RangeSum(Above(count(Amount),-1,1))


What I am struggling with is adding in a additional dimension (Category), as if I do this, the expression fails.


thank you

Not applicable
Author

Okay.  Try this instead of your range expression

count(Amount)-Above(Count(Amount))

This will populate the cells when you add Category.  You will then want to sort the chart so the expression works the way you need it.  For example, if you need the change for each product over time, sort by product - text A->Z

Not applicable
Author

Thank you Caleb