Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have Quarter Year field in this format, 20183, 20182, 20181, 20174, 20173, 20172, 20171 and so on.
I would like to create a variable for the the previous quarter calculation.
So, When the user select 20183 they will see the current Quarter value and 20182 will be the previous Quarter value.
I was trying with this: =Left(QuarterYear,4)&(Right(QuarterYear,1)-1) but when i select 20181 its giving me 20180 rather than 20174.
Any help?
Hi Sunny,
As you mentioned,
So if i create the new field as
=QuarterStart(MakeDate(Left(QuarterYear, 4), Right(QuarterYear, 1)*3)) as QuarterYear_New
Then the set analysis would be:
Sum({<QuarterYear_new = {"$(=QuarterStart(Max(QuarterYear_nee), -1))"}>} Measure)
Is that right?
Thanks,
BC
Yup, this
Sum({<QuarterYear_new = {"$(=QuarterStart(Max(QuarterYear_new), -1))"}>} Measure)
Thanks Sunny!
I am Not sure why but when i do sum(Measure) i get some value for example but with your calculation i get 0.
Thanks,
BC
Are you making selection in any date or time field?
Yes, I am making selections on the QuarterYear field.
Then you need to ignore selection in that field because selection and set analysis are contradicting each other
Sum({<QuarterYear_new = {"$(=QuarterStart(Max(QuarterYear_new), -1))"}, QuarterYear>} Measure)
Hi Sunny,
If i cant get values by That field selections then the solution wont be useful for my situation.
Thanks,
BC
Hi Sunny, I actually tried before replying to you.
But ignoring the selection field has no effect on the calculation. So how do i get any previous period based on the selection if i cant select the field?
I am confused though.
Thanks,
BC
So, you select a single QuarterYear and use this expression
Sum({<QuarterYear_new = {"$(=QuarterStart(Max(QuarterYear_new), -1))"}, QuarterYear>} Measure)
and nothing happens? What do you mean when you say nothing happens? See 0s? or nothing get filtered out?
Would you be able to share a sample to show the issue? This can be a small issue, but very difficult to know without something to look at.