Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I want to compare the Sum of sales for the last 12 month and for the previous 12 month on the scatter plot
For example, I compare these 2 dates : 12/03/2017 - 12/04/2018 and 12/03/2016 - 12/04/2017
I use this formula to calculate last 12 Month
Sum({<date={">=$(=timestamp(MonthStart(Today(),-12)))<=$(=timestamp(Today()))"}>}FactSoldAmount)
To compare Last 12 month to the Previous 12 month I wrote this, but it doesn't seem correct. Can someone help me ?
Sum({<date={">=$(=timestamp(MonthStart(Today(),-12)))<=$(=timestamp(Today()))"}>}FactSoldAmount)
-
Sum({<date={">=$(=timestamp(MonthStart(Today(),-24)))<=$(=timestamp(Today(),-12))"}>}FactSoldAmount)
current 12months
=SUM({$<DateField = {'>=$(=YearStart(Today()))<=$(=MonthEnd(Today()))'}>}sales)
last 12months
=SUM({$<DateField = {'>=$(=AddMonths(YearStart(Today()),-12))<=$(=AddMonths(MonthEnd (Today()),-12))'}>}sales)
I don't want current 12 Months.
Today is April I want to have all months from 2017 March to 2018 April and From 2016 March to 2017 April ---- I want something like this. And also, I should see the difference between these years
Previous 12 months can be best Achieved in data model.
PFA Solution.
Hello
am also new to qlik...I tried check check below expressions.
Mrach 2017-April 2018
=SUM({<OrderDate = {">=$(=YearStart(Today(),-1,3))<=$(=MonthEnd(Today()))"}>}Sales)
March 2016- April 2017
=SUM({<OrderDate = {">=$(=YearStart(Today(),-2,3))<=$(=YearEnd(Today(),-2,4))"}>}Sales)