Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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
Not applicable

Re: Compare data of different tables using text object

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

swuehl
Not applicable

Re: Compare data of different tables using text object

Try maybe

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

its_anandrjs
Not applicable

Re: Compare data of different tables using text object

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

Re: Compare data of different tables using text object

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

Not applicable

Re: Compare data of different tables using text object

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


Thank you!

maxgro
Not applicable

Re: Compare data of different tables using text object

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

Not applicable

Re: Compare data of different tables using text object

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

MK_QSL
Not applicable

Re: Compare data of different tables using text object

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

Not applicable

Re: Compare data of different tables using text object

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

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

regards

Darek