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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count Key values from one table, but not all tables

I would like to count the number of distinct key value (AccountID) on one table (TableA), but not count the key values on another table (TableB).  I have attached a QVW to illustrate.  In TableA, there are 4 distinct AccountIDs, but when using count distinct, it returns 8, which is the distinct count across all tables that have an AccountID column.  I would like to retreive the distinct count from only TableA.  Any ideas?

Thanks!

1 Solution

Accepted Solutions
avinashelite

Hi Robert,

Please find the attachment for the solution.

Regards,

@vi

View solution in original post

4 Replies
nam
Former Employee
Former Employee

put a flag in each table with value of 1 and sum the appropriate in the UI.

so in the set analysis put flag=1 for the appropriate table when counting

Anonymous
Not applicable
Author

both table are concatented into one table Holding all values. so 8 is the correct answer.

if you Need two table you have to define for table b

Table B

noconcatenate load  ...

but then you have the same field in two tables and the result will be the same.

to get only the values of table A you need to gibt AccountID a different Name than

in TableB!

TableA:
AccountID1

..

TableB:
AcountID2,

...

What is the Business issue? The current example makes no sense.

avinashelite

Hi Robert,

Please find the attachment for the solution.

Regards,

@vi

anbu1984
Master III
Master III

Try this