Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi there,
Trying to get my previous sales from last month subtracted from the current sales this month, so it shows the amount of sales (less or more) than the previous.
My current set analysis:
Count({<Month={">=$(=MonthStart(AddMonths(Max(Month),-1))) $(=MonthStart(AddMonths(Max(Month),0)))"}>}Sales_total)
This giving the wrong result, obviously. Not too sure how to structure my analysis. Any assistance would help.
Thanks.
Where are you trying to do this? In a text box object or a chart? If in a chart is your dimension Month (or some date time related dimension?)
Hi,
Trying to do this in a KPI.
The date (month) is a dimension.
Are you trying to count the Sales_Total?
Hi
try this
Count({<Month={">=$(=MonthStart(AddMonths(Max(Month),-1))) $(=MonthEnd(AddMonths(Max(Month),0)))"}>}Sales_total)
or
count({<Month={">=$('>=' & MonthStart(AddMonths(Max(Month),-1)))&'<='& MonthEnd(AddMonths(Max(Month),0))"} Sales_total)
if the data type of Month field is dual type (string and integer) use below expression
sum({<Month = { $(=month( MakeDate(1999, max(Month) ,1) ) ) }>} Sales_total) - sum({<Month = { $(=month( MakeDate(1999,( max(Month) - 1 ) ,1) ) ) }>} Sales_total)
and if Month field is already an integer, you can use below
sum({<Month = { $(=max(Month)) }>} Sales_total) - sum({<Month = { $(=max(Month)-1) }>} Sales_total)
regards,
What is the month's field format?? Try this:
Count({<Month={"$(='>=' & Date(MonthStart(Max(Month),-1)), 'DateFieldFormatHere') & '<' & Date(MonthStart(Max(Month),0), 'DateFieldFormatHere'))"}>} Sales_total)
Hi,
No I already have a COUNT of sales using the current expression:
COUNT({$<Sales_total={">0"}>} Sales_Total)
The dimension drives the months when selected.
Trying to do it when Month (June) - (May) gives a remainder of what the difference is (+ OR -).
Thanks.
YYYY-MM
(2016/05)*
Count({<Month={"$(=MonthStart(AddMonths(Max(Month),-1)))Sales_total) //This will give your a count of last month
-
Count({<Month={"$(=MonthStart(Max(Month))Sales_total) //This will give you a count of this month
//Subtraction will give a variance result