Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have multiple if conditions in front end.. I want to create flag for that expressions ,how can I do that in scripting? And how can iget that flag in set analysis.
can anyone suggest the best way to do it?
1.if(Time>Critical,number,null())
2. if(Time>=Urgent and Time<=Critical,number,null())
3.if(Time>=Normal and Time<=Urgent,number,null())
4.if(Time>=Medium and Time<=Normal,number,null())
5.if(Time<=Normal,number,null())
Thanks
Sonica
May be like:
Load
If(Time>Critical, 1) as Flag1,
If(Time>=Urgent and Time<=Critical,1) as Flag2,
....
Then in the front-end:
1: Sum({<Flag1={1}>}number)
2: Sum({<Flag2={1}>}number)
...
May be like:
Load
If(Time>Critical, 1) as Flag1,
If(Time>=Urgent and Time<=Critical,1) as Flag2,
....
Then in the front-end:
1: Sum({<Flag1={1}>}number)
2: Sum({<Flag2={1}>}number)
...
if (Time>Critical ,1,
if(Time>=Urgent and Time<=Critical ,2 ,
if(Time>=Normal and Time<=Urgent ,3,
if(Time>=Medium and Time<=Normal ,4,
if(Time<=Normal ,5 , Null() ))))) as Flag
Then use this in front end
Sum({<Flag={1}>}Sales)
...
Add this to your load script (adapted to your exact requirements):
LOAD
...
If(Time>Critical, 1,
If(Time>=Urgent, 2,
If(Time>=Normal, 3,
If(Time>=Medium, 4,
If(Time<=Normal 5, null()))))
) as Flag,
...
Then your set expression becomes:
Sum({<Flag = {1}>} Amount) |
Hi Sony,
Please use below code in script:
if(Time>Critical,'Critical1',
if(Time>=Urgent and Time<=Critical,'UrgentandCritical2',
if(Time>=Normal and Time<=Urgent,'NormalUrgent3',
if(Time>=Medium and Time<=Normal,'MediumNormal4',
if(Time<=Normal,'BelowNormal5',null()))))) As [Flag Condition]
Thanks,
Arvind Patil