Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
lynn2
Contributor II
Contributor II

set analysis not working

Hi all, I'm new to Qlik and I can't seem to get my set analysis to work. I'm trying to count the number of instances where the dimension returns a specific value. Here's my expression:

Count({<[MILESTONE_STEP] = {"APPLICATION_DRAFT_CREATED"}>}[MILESTONE_SUMMARY.MILESTONE_STEP_ID])

The expression seem correct and is able to be applied. However the count returned is not meeting the condition stated, it just returns the total count

 

Labels (1)
  • SaaS

7 Replies
techguy100
Contributor II
Contributor II

Based on the expression you provided, it looks like the set analysis is correctly filtering the [MILESTONE_SUMMARY.MILESTONE_STEP_ID] field based on the condition [MILESTONE_STEP] = {"APPLICATION_DRAFT_CREATED"}.

However, it's possible that the issue lies with the [MILESTONE_STEP] field itself. Double-check that the [MILESTONE_STEP] field is in the same data model as the [MILESTONE_SUMMARY.MILESTONE_STEP_ID] field, and that the [MILESTONE_STEP] values match exactly with {"APPLICATION_DRAFT_CREATED"} (i.e. check for any whitespace or other formatting issues).

Another possibility is that there may be other filters being applied to the chart or table where the expression is being used. Try removing any other filters to see if that affects the count.

If neither of these solutions work, it may be helpful to provide more information about your data model and the chart or table where the expression is being used, so that others can better understand the issue and provide more targeted assistance.

 

Regards,

Rachel Gomez

Chanty4u
MVP
MVP

Try this 

Count({<[MILESTONE_STEP] = {"APPLICATION_DRAFT_CREATED"}>} DISTINCT [MILESTONE_STEP])

BrunPierre
Partner - Master
Partner - Master

@techguy100 Is it possible that you are failing to count the expression's unique values?

Count( DISTINCT {<[MILESTONE_STEP] = {"APPLICATION_DRAFT_CREATED"}>}[MILESTONE_SUMMARY.MILESTONE_STEP_ID])

lynn2
Contributor II
Contributor II
Author

hey @techguy100, thanks for replying. I've checked the formatting & filters, all seems okay. I'm investigating my data model and seems like the issue lies with counting the null values. I've rewritten my expression to the following but it doesnt seem to be picking up the 2nd condition

Count({<[MILESTONE_STEP] = {"APPLICATION_DRAFT_CREATED"}, [MILESTONE_STEP_ID]-={"'-'"}>}DISTINCT [MILESTONE_SUMMARY.MILESTONE_STEP_ID])

 

Here's a screenshot of sample data from my data model:

lynn2_0-1683712500192.png

 

lynn2
Contributor II
Contributor II
Author

Hey @Chanty4u, thanks for replying. The DISTINCT syntax did help with counting distinct values only, thanks for pointing that out. However I'm still getting an error, believe that my expression is counting the null values. I've changed it to this but it doesnt seem to be meeting the 2nd condition

Count({<[MILESTONE_STEP] = {"APPLICATION_DRAFT_CREATED"}, [MILESTONE_STEP_ID]-={"'-'"}>}DISTINCT [MILESTONE_SUMMARY.MILESTONE_STEP_ID])

 

Here's a screenshot of sample data from my data model:

lynn2_1-1683712678375.png

 

lynn2
Contributor II
Contributor II
Author

Hey @BrunPierre, thanks for replying.  I added the DISTINCT syntax at [MILESTONE_SUMMARY.MILESTONE_STEP_ID] and it seems to work. Should there be another DISTINCT syntax at the front?

BrunPierre
Partner - Master
Partner - Master

Hi, one is enough, either place it in front or behind the set expression.