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: 
mhapanka
Creator
Creator

logic check for set analysis

Could an expert please help me out on the logic for this set analysis-

My code , in order to count entries in a region that have  blank data is as follows:

Count({$<[District missing] = {'District missing)'}>

+ <[PostalCode missing]={'PostalCode missing'}>

+ <[State missing]={'State missing'}>

+ <[Country missing]={'Country missing'}>

+ <[MapPoint missing]={'MapPoint missing'}>

}Region1)

and to count entries in a region that do not have any inadequacies or blanks in data:

Count({$<[District missing] -= {'District missing)'}>

+ <[PostalCode missing]-={'PostalCode missing'}>

+ <[State missing]-={'State missing'}>

+ <[Country missing]-={'Country missing'}>

+ <[MapPoint missing]-={'MapPoint missing'}>

}Region1)

The above two Master items I am showing as a stacked bar chart

I also am showing in another graph the total entries by Region with the measure as follows:


=count(Region1)



This total is appearing the same as the number of 'no Blanks' (same as output of green) when it should in fact match the total of each stack.



Could someone tell me where my logic is wrong in this?

5 Replies
petter
Partner - Champion III
Partner - Champion III

For your green expression if you don't have one or more entries with all of the fields you list missing then the number would be the same as Count(Region1) ... isn't that obvious?

I would rather use this which I find easy to grasp:

Count( { $ - $<[District missing] = {'District missing)'}>

+ <[PostalCode missing]={'PostalCode missing'}>

+ <[State missing]={'State missing'}>

+ <[Country missing]={'Country missing'}>

+ <[MapPoint missing]={'MapPoint missing'}>

} Region1)

mhapanka
Creator
Creator
Author

I Understand, but I do have missing values across all regions,  I thus expected the total values to not match the output of the green.

mhapanka
Creator
Creator
Author

My numbers didnt change after using this, perhaps the mistake is in the Red or the Black one?

petter
Partner - Champion III
Partner - Champion III

Without seeing the data model it is hard for me to have an opinion on that...

marcus_sommer

I think I would rather use a single numeric flag instead of multiple string-flags. Maybe with something like:

...

rangecount(District, PostalCode, State, ...) as Flag

...

and then

count({< Flag {">=1"}>} Region1) respectively count({< Flag {0}>} Region1)

and with some additionally logic you could also create a numeric flag which could differ between the various missing values.

- Marcus