Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
I am new to qlikview.
my requirment is that,
what ever month user select,
I want to considere everything from previous one month from currently selected month.
below is the example :
I have selection box as below and I have a data for each month in the qvd.
Report Month
Jan-2014
Feb-2014
Mar-2014
Apr-2014
if user select Apr-2014, then,
I want to considere all the data from Mar-2014 and I want to display those data from Mar-2014 in straight table.
if user select Mar-2014,
then,
i want to cinsidere all the data from Feb-2014 and i want to display those data from Feb-2014 in straight table.
How can we do this in qlivkew ?
any help would be appreciated.
Thansk!.
In you expression type max(report month)-1
If you are using a Master Calendar then add a line to that to create the ReportMonth
For example, let's say your data contains the field OrderDate (and that your master calendar is built with TempDate) then add the line:
Date(AddMonths(TempDate,1), 'MMM-YYYY') AS ReportMonth,
Then you could use a listbox for ReportMonth and whichever month you select will give you all records where OrderDate is 1 month before your ReportMonth.
For more about how to use a Master Calendar see The Master Calendar
Create a variable and name it vLastMonth for example and put the following expression in the variable
max(Month)-1
then use the following expression in your report
sum({$<Month={'=$(vLastMonth)'}>} [Your Measure])
I used this expression in
=sum(
{1< MDate = {'$(=Date(MonthStart(AddMonths(Today(), -1)),'DD/MM/YYYY') )' ' --- add further conditions if necessary--- ' }>}
Measure)