Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor II
Contributor II

Replace if statement with set analysis

Hi all,

I  have two isolated tables which contain a key logically link to each other (ID1 & ID2).

DataA:
Load * inline [
ID1, Value1
A, TestA
B, TestB
C, TestC
];

DataB:
Load * inline [
ID2, Value2
A, TestX
B, TestY
C, TestZ
];

 

My expected result table is like this:

ID1   Value1   Value2

A       TestA      TestX

B       TestB      TestY

C       TestC      TestZ

 

It can be done by using this expression in columne Value2.

=aggr(only(if (ID1=ID2, Value2)), ID1)

However, due to performance issue (actually no. of records is more than 10 thousands), may i know if it is possible to change the if statement to set analysis?

I have tired the followings but it only works when one ID1 is selected.

=aggr(only({$<ID2={'=ID1=ID2'}>} Value2), ID1)

 

Thanks a lot,

Shirley

4 Replies
Highlighted
Partner
Partner

Re: Replace if statement with set analysis

ID2=p(ID1)
Highlighted
MVP & Luminary
MVP & Luminary

Re: Replace if statement with set analysis

Rename field ID2 to ID1.

talk is cheap, supply exceeds demand
Highlighted
Contributor II
Contributor II

Re: Replace if statement with set analysis

Thanks for the prompt reply.
Due to some restrictions, i cannot rename to associate these 2 fields together in data model. The logic can only be implemented via UI.

Highlighted
Contributor II
Contributor II

Re: Replace if statement with set analysis

Thanks for the suggestion.

Tried ID2=P(ID1), but seems still doesn't work.