Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
How can i calculate previous 6 months Sales here in below script.
Note: In UI level i can achieve this, finding difficulty to calculate in script level .
Thank You,
Cheers,
Ganesh
use set analysis
sum({<yourdatefield={'>={$(=addmonths(max(yourdatefield),-6))}<=yourdatefield{$(=max(yourdatefield))}'}>}sales)
maybe you need to adjust expression
Hi Rudolf,
I suppose we can not use set analysis in script. I want to calculate in Script as like Sum(Sales) which i did in script.
Cheers,
Ganesh
something like the attached?
note the set statement :
SET DateFormat='DD/MM/YYYY';
and use a calendar :
Hi ioannis,
if i want Current Month vs next 3 rolling month than what i need to do?
thanks
AsOfMonth:
load
Month as Month_AsOf,
Month + 1 + IterNo() as Month
Resident tmp_SO
while IterNo() <= 3;
plus in IterNo instead of minus
and 3 instead of 6 in the while clause
see Calculating rolling n-period totals, averages or other aggregations for more details / suggestions
sum({<datefield={">=$(=addmonths(max(datefield),-6))<=datefield$(=max(datefield))"}>}sales)
use if() in script level