Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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?

Tags (1)
5 Replies
Highlighted
MVP
MVP

Re: logic check for set analysis

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)

Highlighted
Creator
Creator

Re: logic check for set analysis

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.

Highlighted
Creator
Creator

Re: logic check for set analysis

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

Highlighted
MVP
MVP

Re: logic check for set analysis

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

Highlighted
MVP & Luminary
MVP & Luminary

Re: logic check for set analysis

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