Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to show previous month. help please.

i want to show value of previous month. but i can't get it and i try follow by forums in qlikview community for this case but it dosen't work.

anyone help me please.

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Probably easiest if you use some variables.

variable vPrevMonth: =date(addmonths(date#(TRANS_YEARMONTH,'YYYY-MM'),-1),'YYYY-MM')

expression: sum( {$<MONTH=,YEAR=,TRANS_YEARMONTH={'$(vPrevMonth)'},FS={'Sales',"Discount*"} >} DIFF )

See attached example.

To make things easier you can use Qlikview Components to create a calendar for you and get a lot of handy set modifiers (like previous month) for free. See Tutorial - Using Common Date Dimensions and Shared Calendars for more information.


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Probably easiest if you use some variables.

variable vPrevMonth: =date(addmonths(date#(TRANS_YEARMONTH,'YYYY-MM'),-1),'YYYY-MM')

expression: sum( {$<MONTH=,YEAR=,TRANS_YEARMONTH={'$(vPrevMonth)'},FS={'Sales',"Discount*"} >} DIFF )

See attached example.

To make things easier you can use Qlikview Components to create a calendar for you and get a lot of handy set modifiers (like previous month) for free. See Tutorial - Using Common Date Dimensions and Shared Calendars for more information.


talk is cheap, supply exceeds demand
Not applicable
Author

Thank you.