Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set Analysis to count where a field matches the value in another field

Hi,

=num(count({<CompanyID ={'$(v_Currently_Selected_CustomerID)'}>}distinct Sales_Records),'#,##0')

As can be seen in the above, I am trying to use set analysis to count

Sales Records

Where the CompanyID is the same value as the CUSTOMERID (stored via a variable).

I think this syntax is incorrect. Any help most appreciated.

H

2 Replies
jvitantonio
Luminary Alumni
Luminary Alumni

It looks good to be. What error are you getting? Remove the num() function first and let me know if it works

Not applicable
Author

Hi

Could you use an expression like this?

=if(CompanyID=GetFieldSelections(v_Currently_Selected_CustomerID), num(count(distinct Sales_Records),'#,##0'),)

This format will require you to always have a CustomerID field selected... but it should work fine..

good luck.