Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Gene_K
Partner - Contributor II
Partner - Contributor II

Set Analysis - Set Modifier difference not working as expected

Seems like I misunderstood how the Set Modifier is meant to work.  Would appreciate if someone can clear things up for me.  I'm attaching a sample application which I'm working from.   In the application is a simple data model with a table for games, a table for invites, and a table for participant. 

What I'm trying to count is the number of times a person has chosen to ignore their invite and not participate in the game in a table format where the dimension is the person.  Should be pretty simple. 

The number of games they have been invited to is :  sum({<NumInvites = {1}>} NumGames)

The number of games they participated in is : sum({<NumParticipations = {1}>}NumGames)

Shouldn't the number of games they chose not to participate in be the difference between the two sets?  

=Sum({

  <NumInvites= {1}> -
  <NumParticipations = {1}>
} NumGames)

 

And, yes, I know I can change the logic to 

sum({<NumInvites = {1}>} NumGames) - sum({<NumParticipations = {1}>}NumGames)

but I want to understand why the difference in SetModifiers does not work.

 

 

Labels (2)
1 Solution

Accepted Solutions
rubenmarin1

Hi, set analysis is calculated before the table, so dimensions don't affect when creating the subset, it applies after the subset is created. Also it applies to the used fields, and NumGames is on the games table, so the access to NumGames is in a direct relation with gameid.

When you do sum({<NumInvites = {1}>} NumGames), the subset has access to the 3 games, and then applies each person filter to the row.

But when you do <NumInvites= {1}> - <NumParticipations={1}>, and all games has at least one participation, you are removing all games from the subset. and the empty subset is applied to each person, so it returns 0 for all.

If you merge all 3 tables in one using joins it will work as you expect.

View solution in original post

2 Replies
rubenmarin1

Hi, set analysis is calculated before the table, so dimensions don't affect when creating the subset, it applies after the subset is created. Also it applies to the used fields, and NumGames is on the games table, so the access to NumGames is in a direct relation with gameid.

When you do sum({<NumInvites = {1}>} NumGames), the subset has access to the 3 games, and then applies each person filter to the row.

But when you do <NumInvites= {1}> - <NumParticipations={1}>, and all games has at least one participation, you are removing all games from the subset. and the empty subset is applied to each person, so it returns 0 for all.

If you merge all 3 tables in one using joins it will work as you expect.

Hannah1X
Contributor
Contributor

Data analysis plays a crucial role in understanding gaming trends, and platforms like glory casino bangladesh https://glorys-casino.com/ leverage this to offer tailored experiences to their users. By analyzing player preferences and behaviors, the platform continuously improves its offerings, ensuring a personalized and enjoyable gaming experience for all.