Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor II
Contributor II

Display previous month data

Hi,

I'd like to have a column that shows data from a previous month. Tried doing this with set analysis however with no luck.

Script regarding this table looks like that:

aleksas_baltpool_0-1594818963077.png

I'm using hau_month as a dimension in the chart. I'd like to display sum(hau_total_amount) for the current and for the previous month. 

 

Tried something like that: sum({<hau_month={$(=Max(hau_month)-1)}>}hau_total_amount)

 

However the result is zeroes. Hope you can help me with it !

1 Solution

Accepted Solutions
Highlighted
MVP
MVP

Above(sum(hau_total_amount), 2)

View solution in original post

12 Replies
Highlighted
Creator
Creator

Hi,

What type of chart you are trying to create. 

Did you try bar chart,  with month(hau_month) in the dimension, and sum(hau_total_amount) as expression. This should show month wise data. 

It would be better if you upload a sample QVW or screenshots along, this will help us give you correct answer. 

cheers,

Basav

Highlighted
Contributor II
Contributor II

Hi, I'm creating a table chart. There is no problem displaying data month wise, however in this case I need to display previous period (month) data in the same column. What would you like to see in the screenshot?

Highlighted
Creator
Creator

Hi,

Please always try to attach sample QVW with sample data, if a precise answer is required. 

Please check these posts, hope these helps:

https://community.qlik.com/t5/New-to-QlikView/Show-previous-month-data/td-p/1246957

https://community.qlik.com/t5/QlikView-App-Development/How-to-show-previous-month-data-in-current-mo...

cheers,

Basav

Highlighted
Contributor II
Contributor II

I've already checked those topics before posting but didn't manage to adapt formulas to my document. 

 

I've uploaded sample file.

Highlighted
MVP
MVP

Try this expression:

=sum(TOTAL {<MonthYear={'$(vPrevMthNo)'}>}[Total Stock])

tresesco_0-1594879342502.png

 

Highlighted
Contributor II
Contributor II

Would it be possible for you to edit this expression according to the sample file I've uploaded? That would be a big help!

Highlighted
MVP
MVP

Sorry, I didn't get you. I have already edited your expression , i.e. - added 'total' in the expression.

Highlighted
Contributor II
Contributor II

Oh sorry wrong file uploaded...

 

This is correct one:

Highlighted
MVP
MVP

When you use month as dimension, try like:

Above(sum(hau_total_amount))