Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hello, I have this in my Dimmension Calculated. Works fine, but Consume a lot of memory How can I traslate this into the script and finally left it like "as".?
=
if(aggr(sum(date(vDate)-Field1),Field2)= vDate, Dual('YTD',1),
if(aggr(sum(date(vDate)-Field1),Field2)>=1 And aggr(sum(date(vDate)-Field1),Field2)<=30, Dual('Period1',2),
if(aggr(sum(date(vDate)-Field1),Field2)>=31 And aggr(sum(date(vDate)-Field1),Field2)<=60, Dual('Period2',3))))
Thanks,
In the data model if Field1 and field2 are in same table; add a column in the script with same if conditions and using group by Field1. Use left join to ensure unnecessary results are not included.
Kiran.
Thanks for your reply. I Tried to put your information on my qvw but doesn't work I attached an example with my code.
Try this.
Kiran.
Thanks. Just last question.
I had a variable Let and I have created a Calendar Object where I choose the last month, so all Fields1 are subtracted on 31/01/2012 for example. So I know you put a variable: Vdate = Today(); How should the variable stay If:
Vdate-Field1 ==> Where Vdate is endMonth.?
Vdate=EndMonth(); ?
Thanks.
Since the periods are defined in script, they cannot be changed in expression level.
To get end of month use MonthEnd(today()).
Kiran.
Many Thanks.