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

COUNT DISTINCT over 2 seperate fields

Hi, having a problem I'm trying to solve for some days I now try asking you.

I have two tables A and B coming from a sql view. "A" shows all assets where software "A" is installed. "B" shows all assets where software "B" is installed. On some assets software "A" is installed as well as software "B".

Now I want a (distinct) number of assets where "A" or "B" is installed - one or both.

Count(Aggr(DISTINCT Count(DISTINCT A_AssetName), B_AssetName))  doesn't work. I mean it is correct syntactically but the result is wrong.

Can anybody out there pleae help me.

Thank you in advance

Best regards

cyberclaus

Labels (3)
11 Replies
Kushal_Chawda

It will work in your scenario as well. You can directly use the query to append the data or you can create QVDs using individual SQL queries and then use QVDs to perform any other operation like join.

for SQL, you can use below

Table1:

SQL Select Asset,Software

FROM dbname.table name ;

Concatenate(Table1)

Table2:

SQL Select Asset,Software

FROM dbname.table name ;

Note: Make sure that column names are same in both query for concatenate load

 

 

cyberclaus
Contributor II
Contributor II
Author

Works fine - THANK YOU

 

You saved my day