Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am trying to do a set analysis to allow the display financial data for the last 3 months in straight table to look something like this:
Current Last Last -1
Total Expenses xx xx xx
In the expression I envisage something like this :
SUM({<$(vCurrentMonth(0))>} Amount)
SUM({<$(vCurrentMonth(-1))>} Amount)
SUM({<$(vCurrentMonth(-2))>} Amount)
I will also may want to add other criteria such as 'Account Type' = "Salaries", so thought something like this :
SUM({<$(vCurrentMonth(0)) , [Account Type] = {'Salaries'}>} Amount)
Am I on the right track, any help appreciated.
Wayne
hi
try like this
SUM({<$(vCurrentMonth)-1 , [Account Type] = {'Salaries'}>} Amount)
create a variable vCurrentMonth = max(month field)
if i was you i would write an if statement something like:
Sum(If( Date > = MonthStart(Today()), Amount) as Current Month
sum(if( Date < MonthStart(Today()) and Date > = Monthstart (MonthStart(Today()) -1), Amount ) as Last Month
sum(if( Date < Monthstart (MonthStart(Today()) -1) and
Date > = MonthStart(Monthstart (MonthStart(Today()) -1) -1), Amount ) as Last-1