Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
himabinduch
Creator
Creator

Rolling 8 Quarters

Hi Experts,

i have three fields

YearQuarter  derived from created date),

YearQuarter_shipped (derived from shipped date),

now i need rolling quarters for this.

i have taken YearQuarter and YearQuarter_shipped as dimensions and my expression is as below to get rolling quarters.

=RangeSum(Before(count({<SHIPPED_DATE={'>=$(=QuarterStart(max(SHIPPED_DATE), -8))<=$(=QuarterEnd(max(SHIPPED_DATE), 0))'},SHIPPED_DATE={'*'}>}DISTINCT ITEM))/

(count(TOTAL <YearQuarter>{$<CREATION_DATE={'*'},CREATION_DATE={'>=$(=QuarterStart(max(CREATION_DATE), -8))<=$(=QuarterEnd(max(CREATION_DATE), 0))'}>}DISTINCT ITEM)))

Thanks,

Hima.

5 Replies
Anil_Babu_Samineni

I am confused, Is there any Question?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
shiveshsingh
Master
Master

What's the error you getting?

himabinduch
Creator
Creator
Author

i am getting Zero values for everything not getting any rolling quarters

Anil_Babu_Samineni

Can you do this for now, Whether values returning or not? This is for last 2 years data. If none of them not working, I would suggest to share sample

=Count({<SHIPPED_DATE={">=$(=AddYears(max(SHIPPED_DATE), -2))<=$(=max(SHIPPED_DATE))"}>}DISTINCT ITEM)/

Count(TOTAL <YearQuarter> {$<CREATION_DATE={">=$(=AddYears(max(SHIPPED_DATE), -2))<=$(=max(SHIPPED_DATE))"}>}DISTINCT ITEM)


OR


=RangeSum(Before(count({<SHIPPED_DATE={">=$(=QuarterStart(max(SHIPPED_DATE), -8))<=$(=QuarterEnd(max(SHIPPED_DATE), 0))"},SHIPPED_DATE={'*'}>}DISTINCT ITEM))/

(count(TOTAL <YearQuarter>{$<CREATION_DATE={'*'},CREATION_DATE={">=$(=QuarterStart(max(CREATION_DATE), -8))<=$(=QuarterEnd(max(CREATION_DATE), 0))"}>}DISTINCT ITEM)))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
himabinduch
Creator
Creator
Author

Hi Anil,

i am not getting proper data. could please find my sample application in below link

so the you will get exactly what i required.

https://community.qlik.com/thread/291517?sr=inbox&ru=171708