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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
FabioManniti
Contributor III
Contributor III

IF Condition returns error

Hello, I have two tables: users and networkcut.

I want to count how many items in users match with the selected networkcut id.

If I don't select any networkcut item it should return 0 (otherwise it would be a too big calculation); so my code is:

IF(GetSelectedCount(netcut_name)=0, 0,
           COUNT(distinct IF(WildMatch(user_hierarchy, '*'&netcut_id&'*')=1, user_id))
)

 

But still, if I don't select any network item, it still processes everything before returning 0 (and since it is too big, it returns an error).

Labels (1)
10 Replies
FabioManniti
Contributor III
Contributor III
Author

Nope, still the same problem

But I don't understand what is the problem with the Set Expression

IF(GetSelectedCount(netcut_name)=1,
     Count(DISTINCT {<user_hierarchy = {"$(='*' & netcut_id & '*' )"}>} user_id),
      0
)

Because apparently it looks like it works