Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
I have field name = aging_ar
This field have number from 1 to 360
I like to create a new filed name = aging_ar_class
which is
1=1-30
2=31-60
3=61-90
In chart dimension expression below working fine :-
=If(aging_ar >= 1 and aging_ar <= 30, Dual('1-30', 1),
If(aging_ar >= 31 and aging_ar <= 60, Dual('31-60', 2), Dual('>61', 3)))
I have try convert the above expression to below for load script expression :-
If(aging_ar >= 1 and aging_ar <= 30, Dual('1-30', 1),
If(aging_ar >= 31 and aging_ar <= 60, Dual('31-60', 2), Dual('>61', 3))) as aging_ar_class,
it does not work , Hope some one can advise me.
Paul
Hello Paul,
May be try below:
If(aging_ar >= 1 and aging_ar <= 30,
'1-30',
If(aging_ar >= 31 and aging_ar <= 60,
'31-60',
'>61')) AS aging_ar_class
Regards!
Rahul
Looks OK to me. What is it doing incorrectly?
The conditions may fail if the ages are computed and are not integers. Modify it to this:
If(aging_ar < 1, Dual('0', 0),
If(aging_ar <= 30, Dual('1-30', 1),
If(aging_ar <= 60, Dual('31-60', 2),
Dual('>61', 3)))) as aging_ar_class,
to guarrantee a value in every row.
Hello Paul,
May be try below:
If(aging_ar >= 1 and aging_ar <= 30,
'1-30',
If(aging_ar >= 31 and aging_ar <= 60,
'31-60',
'>61')) AS aging_ar_class
Regards!
Rahul
Hi Rahul
Wow you are good. Thank you very much.
Paul Yeo
Cheers,
Rahul