Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Qliksupport Team,
I am trying to compare last month figures with current month figures and able to achieve it using the below formula...
Month(SNAPSHOT_PERIOD) as Month,
Date(MonthStart(SNAPSHOT_PERIOD), 'MMM-YYYY') as [Month Year],
Year(SNAPSHOT_PERIOD) as Year
From a table...
&
set vMaxMonthYear = =Date(max([Month Year]), 'MMM-YYYY');
set vPriorMonthYear = =Date(addmonths(max([Month Year]), -1), 'MMM-YYYY');
let vMaxDate = '=max(Date)';
let vMaxDay = '=day(vMaxDate)';
let vMaxMonth = '=month(vMaxDate)';
let vMaxYear = '=Year(vMaxDate)';
let vPriorMonth = '=month(addmonths(max(Date),-1))';
let vPriorYear = '=vMaxYear-1';
let vPriorYearDate = '=date(addyears(max(Date),-1),' & chr(39) & 'DD MMM YYYY' & chr(39) & ')';
Created above variables...
Last month expression ::
='Last Month Fact_Resrv_1
$(vPriorMonthYear)'
Current Month Expression ::
Sum({<[Month Year]={'$(vMaxMonthYear)'},Year=,Month=,Date=>}CHNL_FACT_RESRV_1)
But however, when I use MonthYear as dimension in the same straight table, the result is as below...
Is it possible to display same as first image even after adding MonthYear as dimension in straight table...?
If possible in any other chart(pivot table), please give the formulas for current & Previous month expressions...