Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Friends
i have a data where Month filed is there which has data like jan, feb, mar,.....dec
and Actuals
i want when filter select feb 2013 then i want
feb 2013 data and jan 2013 data
MON | Year | Actual |
---|---|---|
Jan | 2013 | 5 |
Feb | 2013 | 7 |
Mar | 2013 | 9 |
so in above if filter select 2013 year and then select feb
then i want
current month previous month
7 5
Ahhhh, ok, Thank You
Hi,
from your script I can see that MON was a string value not a date field. Max() function does not work with strings. In general I recommend to use a "MonthID" concept where you create s sequence for every month period and work with that in your set analysis.
To create a MontID add this to your script:
Num#(YR)*12+Num(Month(Date#(MON, 'MMM')) as MonthID
Then is expressions you can use
//current month
Sum({<Year, Month, MontID={$(=Max(MontID))}>} Actual) //turn off selections on all date fields and only select by MonthID
//previous month
Sum({<Year, Month, MontID={$(=Max(MontID)-1)}>} Actual)
Hope this helps.
Juraj
Thanks a lot buddy
I have one more problem i have one more columns quarter as string what will i have to do
thanks again
Hi, I'd calculate quarter from Month field, so you do not need to convert any strings. But I'll try to omit using it, quarters can get tricky