Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have 24 months data(2018 & 2019), Need to create a pivot table.
Dashboard should display last 3 months data and if i select a month 2019-march, dashboard should display 2019-march,2019-Feb,2019-Jan. If i select 2019-Jan,dashboard should display 2019-Jan,2018-Dec,2018-Nov.
How to achieve this.
Dimension:
Product
S_date
Metric:
Revenue
Thanks in advance 🙂
Hi,
Try by using below expressions
Dimension:
Product
Measure:
Sum ({< YearMonth= {">=$(=Date (AddMonths (Date (YearMonth,'YYYY-MMM'),-5),'YYYY-MMM')) <=$(=Date (YearMonth,'YYYY-MMM'))”}>} Revenue)
Column Condition:
aggr(only({<YearMonth={">=$(=date(monthstart(addmonths(YearMonth,-5)),'YYYY-MMM'))<=$(=date(YearMonth,'YYYY-MMM'))"}>}YearMonth),[YearMonth])
I haven't used max function in date fields, by using max function I am always getting (max month -6) month result. But the issue is by using above expression my pivot table showing result as null, so result will be shown only when selecting a month filter pane.
If need to show something when end user opening dashboard, having two options
1) Setting default bookmark - https://help.qlik.com/en-US/sense/February2019/Subsystems/Hub/Content/Sense_Hub/Bookmarks/set-defaul...
2) Always one selected value - https://help.qlik.com/en-US/sense/February2019/Subsystems/Hub/Content/Sense_Hub/DataSource/select-si...
Try adding a year-month filter based on your need. Qlik sense allows you to select multiple values at a time. (attached snapshot for reference)
If you are looking for help in creating a pivot table : Qliksense Pivot table
Do let us know with more details, if you need additional help.
Regards,
Santhosh Ashokkumar
Hi Nivetha,
You can't do this when selecting a month. Because the engine can't know that you want three months. A possibility is, when you use the Qlik Sense February update, that you use the Variable Input. In this variable you make the selection 'Selected month' till 'Selected month - 3'.
Jordy
Climber
Hi,
Make sure if you are giving the year selection in front end then nullify the Year in your set analysis as well.
If this is not the case then please share the sample app.
=SUM({$<YoureDateField = {'>=$(=AddMonths( MontStart (Today()),-6))<$(=Monthhend(Max(date))'}>}Sales)
if you have date this expression will go back 6 months from selected month
Hi Miskinmaz,
Attached my app and sample data.
Hi
Please create the new field
date(MonthStart(S_date),'YYYY-MMM') as YearMonth
and use this field in set analysis and dimension.
Created field in script and used year month in my column expression, but still i am not getting expected result.
aggr(only({<S_date={">=$(=date(monthstart(addmonths(max(S_date),-5)),'DD/MM/YYYY'))"}>}YearMonth),[YearMonth])
please share sample app for reference.