Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis Odd Behaviour

I have a simple set analysis expression to count the number of people who have installed a toolbar as below.

version A: count( {$ <toolbar_downloads.Date = {'*'}>} DISTINCT supporter_id)

version B: count( {$ * <toolbar_downloads.Date = {'*'}>} DISTINCT supporter_id)

With no filters applied I would expect both to give the same result, and to differ only where filters are applied - version A should ignore filters whereas version B should account for them because it has the *.

However, only version A gives exactly the answer I expect while version B gives a significantly lower number. I tend to opt for the version B in this type of expression as it allows for filters, but I'm quite confused as to why it gives a different result here. Note there are other joined tables with additional supporter_id in them which don't exist in the toolbar table, which is why I'm using the set analysis in the first place.

5 Replies
ThornOfCrowns
Specialist II
Specialist II

I would think that your first expression would be influenced by filters, all values would normally use count({1})?

Also ignoring the date, which I presume the = {'*'} means is normally done by toolbar_downloads=, i.e.

Count({1<toolbar_downloads.date=>} DISTINCT supporter_id)

Am I missing something?

mikecrengland
Creator III
Creator III

Are you trying to filter within your date field (intersection)? Try putting the * right before the = sign:

count( {$ <toolbar_downloads.Date *= {'*'}>} DISTINCT supporter_id)


mike

Not applicable
Author

Interesting, that works fine. Intersection is indeed what I want, so that if I have other filters of any type applied (including date), these will be taken into account.

However, I'm still confused as to why my version with the * before the <> did not work. I occasionally need to place the * operator in between different expressions e.g. <...> * <...> * <...>,  and this works fine. Therefore I'd like to understand what the * before the set analysis expression is actually doing, and why it's giving a different result

Not applicable
Author

I'm using the {'*'} to get all records that have a download date, rather than ignoring the selection. This is because I have the supporter_id key field in multiple tables, and some of these have many supporter IDs that don't exist in the toolbar_downloads table, so to get the count of users who have downloaded, I'm simply saying where date exists, by using {'*'}

mikecrengland
Creator III
Creator III

Hmmmm, I've never used the * before the set before, though like you, between sets works. If you search the community for QlikLearn-Set-Analysis-Presentation.pdf, it may be able to give you some more insight that I don't have...

mike