Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
i have month field and sales
i want comapre in single chart for current month sales and previous month sales ?
Can you tell me the format of you the data values in your month field ? Are they dates ? Month Numbers (1-12) ? Month names (Jan-Dec) ? That is the key piece to providing an expression that may work.
Set analysis using max month and max month -1. As JP stated above, would need the format before sharing any code. You might need to create a date convert crosswalk table for the calc as well.
Hi,
here we need to write the set analysis,we can dynamically and static also.
for dynamic we can use several ways like directly give month or create a variable and place it in set analysis syntax.
month numbers
Will the current month be based off Today's month or some other month ? For example, it might be the most recent month in your data .
Still a bit of guess work, but if your data field is 'Month' and it stores values as 1-12, here are your 2 expressions. Sales is the $ amount field of the Sales.
Current Month: Sum ( {$<Month = {'$(=Num(Month(Today())))'}>} Sales)
Previous Month: Sum ( {$<Month = {'$(=Num(month(AddMonths(Today(),-1))))'}>} Sales)