Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
mikelees80
Contributor
Contributor

Set Analysis with zero length / null

HI All

I'm trying to write some set analysis to give all the  orders we have that is missing a item division due to incorrect set up

here is my currently set analysis

sum({$<[Item - IH Division]={"=len(trim([Item - IH Division]))=0"}>} [Quantity - Ordered])

I've read multiple threads on here saying this should work example  Blank or NULL in Set Analysis  however i can't get it to work.

I don't want to use an if statement becuase that hits performance

Any ideas?

4 Replies
Anil_Babu_Samineni

What is the issue with this expression? Seems okay to me

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
sunny_talwar

May be create a flag in the script

If(Len(Trim([Item - IH Division])) = 0, 1, 0) as Flag


and then this

Sum({$<Flag = {1}>} [Quantity - Ordered])

mikelees80
Contributor
Contributor
Author

My quantity ordered returns 0

example set analysis i have tried, using an If statment works but not set analysis

   

Item - IH Divisionsum({$<[Item - IH Division]={"=len(trim([Item - IH Division]))>=0"}>} [Quantity - Ordered])sum([Quantity - Ordered])sum({$<[Item - IH Division]={"=len(trim([Item - IH Division]))=0"}>} [Quantity - Ordered])sum(if(len(trim([Item - IH Division]))=0,[Quantity - Ordered],0))if(len(trim([Item - IH Division]))>0,sum([Quantity - Ordered]),0)
BREAST HEALTH1,166,2941,166,294001,166,294
DIAGNOSTIC95,400,80495,400,8040095,400,804
FREIGHT8,3988,398008,398
OTHER551,589551,58900551,589
SKELETAL HEALTH100,992100,99200100,992
SURGICAL427,281427,28100427,281
TBD344,846344,84600344,846
-025,748,1760101,471,6150
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

It would be useful to see a screenshot of the tablemodel.

-Rob