Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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
MVP & Luminary
MVP & Luminary

Re: How to show previous month. help please.

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
2 Replies
MVP & Luminary
MVP & Luminary

Re: How to show previous month. help please.

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

Re: How to show previous month. help please.

Thank you.

Community Browser