Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
I have below load script working fine :-
If([GL_CODE_]>=5000001 and [GL_CODE_]<=5999999,'rEVENUE_P') as [rEVENUE_P],
If([GL_CODE_]>=6000001 and [GL_CODE_]<=6999999,'cOG_P') as [cOG_P],
I try to make use of load script to compute the net profit amount as below :-
If([GL_CODE_]>=5000001 and [GL_CODE_]<=5999999,'rEVENUE_P')-
If([GL_CODE_]>=6000001 and [GL_CODE_]<=6999999,'cOG_P') as [nET_P],
I get the return value = 0 which is wrong. Hope some one can advise me.
Paul
Hi, I don't know what you mean as the first is working fine.
That code assigns the string 'rEVENUE_P' to the field rEVENUE_P, that's the value it has: a string. Same for cOG_P field.
So you cant do math operations with strings
Maybe with:
Rangesum(If([GL_CODE_]>=5000001 and [GL_CODE_]<=5999999,Amount)
,-If([GL_CODE_]>=6000001 and [GL_CODE_]<=6999999,Amount) as [nET_P],
Hi, I don't know what you mean as the first is working fine.
That code assigns the string 'rEVENUE_P' to the field rEVENUE_P, that's the value it has: a string. Same for cOG_P field.
So you cant do math operations with strings
Maybe with:
Rangesum(If([GL_CODE_]>=5000001 and [GL_CODE_]<=5999999,Amount)
,-If([GL_CODE_]>=6000001 and [GL_CODE_]<=6999999,Amount) as [nET_P],