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

Compare data of different tables using text object

I need to find out the matching distinct values in col1 of table 1 and table2. I need the result in a text object.Also, if possible I do not wish to create any additional tables in the data model. Can anyone help?


TABLE1:
LOAD * INLINE [
COL1, COL2
A,2
B,4
C,5
D,2
H,3
]
;

TABLE2:
LOAD * INLINE [
COL1,COL4
A,4
B,4
A,23
]
;

14 Replies
MK_QSL
MVP
MVP

As per your question what result you are looking for this tables?

swuehl
MVP
MVP

Try maybe

=concat({<COL2 = {"*"},COL4={"*"} >}DISTINCT COL1,', ')

its_anandrjs
Champion III
Champion III

When you load this two tables then there is common field name COL1 and then there is association between two tables and you get a primary key field then how you identify the key values is from which table.

Not applicable
Author

Anticipated result = 2 since values 'A' and 'B' are common in both tables

Not applicable
Author

I getting the output as 'A,B'. Can I get its count which is '2' instead.


Thank you!

maxgro
MVP
MVP

=concat(aggr(if(count(COL2)+count(COL4)>1,COL1),COL1),', ')

Not applicable
Author

Thank you.Can I get a count of this result??

MK_QSL
MVP
MVP

=Index(concat({<COL2 = {"*"},COL4={"*"} >}DISTINCT COL1,', '),',')

Not applicable
Author

simple change concat into count in swuehl expression, like this:

=count({<COL2={'*'},COL4={'*'}>}distinct COL1)

regards

Darek