Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ioannagr
Creator III
Creator III

is null in set analysis

I'm trying to convert 

sum(If(isnull(id1) and isnull(id2) and not isnull(id3), bags)

 

into set analysis like this, but it doesn't work.

 

sum({<id1={"="len(id1)={'0'}"}>*<id1={"="len(id1)={'0'}"}>*<id3={"*"}>}bags) 

 

what should i do?

1 Solution

Accepted Solutions
Dmk
Contributor II
Contributor II

You can create a field in your data:

if(isNull(id1),1,0) as id_null_flag

then just put in set analysis id_null_flag={"1"}

View solution in original post

6 Replies
Dmk
Contributor II
Contributor II

You can create a field in your data:

if(isNull(id1),1,0) as id_null_flag

then just put in set analysis id_null_flag={"1"}

Anil_Babu_Samineni

Perhaps this

sum({<id1={"=Len(id1)=0"}, id2={"=Len(id2)=0"}, id3-={"=Len(id3)=0"}>} bags)
Or
sum({<id1={"=Null()"}, id2={"=Null()"}, id3={"=Not Null()"}>} bags)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
ioannagr
Creator III
Creator III
Author

@Dmk sorry, meant to write sum({<id1={"="len(id1)={'0'}"}>*<id2={"="len(id2)={'0'}"}>*<id3={"*"}>}bags) 

ioannagr
Creator III
Creator III
Author

@Anil_Babu_Samineni  none works 😫 gives me zero but i know it's not a right number. Thanks anyway

sunny_talwar

Why don't you create a flag in the script like this

If(isnull(id1) and isnull(id2) and not isnull(id3), 1, 0) as CheckFlag

and then this

Sum({<CheckFlag = {'1'}>} bags) 
Scott2
Contributor III
Contributor III

seems Set analysis doesnt work for this use case. Perhaps as null are not selectable then it doesnt work in Set analysis. Seems like a gap to me. If anyone else has ever got this to work let us know. I tried all the set analysis suggestions and resorted to the flag approach in the end too.