Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a dimension in which sometime the value is coming null...
Suppose FM= -
PM= 6
CM=PM + FM(6 + null = null) = null
now when i am putting condition (if CM= NULL() ,0 , CM)
CM is still coming - i.e CM= -
i need zero here
can someone help me
Hi,
Try with
if(CM = NULL() Or CM='-' ,0 , CM)
Regards,
Anand
NAAH NOT WORKING
Hi,
Provide any sample file but it is worked on my end see this example
LOAD if(FM = NULL() Or FM='-' ,0 , FM) as NewField,
FM,PM;
LOAD * Inline
[
FM,PM
-,6
1,7
5,8
];
Regards
Anand
3 different solution to solve this
alt
len trim
rangesum
a: // test data
load null() as FM, 6 as PM
autogenerate 1;
load // solutions
alt(FM,0) + PM as solution1,
if(len(trim(FM))=0, 0, FM) + PM as solution2,
rangesum(FM, PM) as solution3
Resident a;