Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have one field period like 2015-Q1, 2014-Q4 , 2014-Q3 ... etc.
so i want current period comparison 2015-Q1 and previous period 2014-Q4 data. so any one can tell how can i achieve this ??
Thanks in advance !!
Deepak
number the periods so that you can reference the previous one in set analysis as current-1:
1 2014Q1
2 2014Q2
3 2014Q3
4 2014Q4
5 2015Q1
etc
HI
Thanks for reply but not working !!
Deepak
Hi,
If you attach sample then it would be easier to provide the solution. You need to create a date field from the Quarter and then you need to use Set Analysis expression for get the previous Quarter value.
Regards,
Jagan.
Take a look at function InQuarter(). Examples:
sum(if(InQuarter(Today(),DateField, 0), Amount)) - returns sum(Amount) for the current Quarter
sum(if(InQuarter(Today(),DateField, -1), Amount)) - returns sum(Amount) for the previous Quarter
Hi Jagan,
Ideally, this should have been taken care into the script itself by generating dual quarters. However, a workaround in the front end using string comparison, could be like in attached sample.
=sum({$<Period ={"$(=Year(QuarterStart(Date#(Period, 'YYYY-QM'),-1))&'-Q'&Ceil(Month(QuarterStart(Date#(Period, 'YYYY-QM'),-1))/3))"} >}Sales)
Hi Tresesco, Thanks for help but i m not getting output which i want when i selecting any other period it not went to previous period same year.
Hi Tresesco, When you do the selection 2014-Q4, than it giving the value of 2014-Q1 so earlier i said it not went to previous quarter.
Sorry, corrected.
PFA
=sum({$<Period ={"$(=Year(QuarterStart(Date#(Left(Period,4)&Right(Period,1)*3, 'YYYYM'),-1))&'-Q'&Ceil(Month(QuarterStart(Date#(Left(Period,4)&Right(Period,1)*3, 'YYYYM'),-1))/3))"} >}Sales)