Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to build a table visualization that contains all the values from table/column A.TO_BE and (in a second column) the output of a measure that checks, whether the value also exists in a second table/column B.AS_IS. If the value exists in the second table, the MEASURE should return "OK", otherwise "NOK". How would I do this in Qlik Sense?
Many thanks,
Thomas
Expected Output:
A.TO_BE | MEASURE
Apple | OK
Pear | OK
Cherry | NOK
Content of table A:
A.TO_BE
Apple
Pear
Cherry
Content of table B:
B.AS_IS
Apple
Pear
Use this :
if(aggr(Count({<Flag_A={1},Flag_B={1}>}A.TO_BE),[A.TO_BE])>0,'OK','NOK')
Add a table flag in both tables in script, or (There can be other columns in both table which you can use).
TableA:
Load A.TO_BE,'1' as Flag_A from Source;
TableB:
Load B.AS_IS as A.TO_BE,'1' as Flag_B from Source;
then in your table in UI add A.TO_BE as Dimension,
Add measure as
If(Count({<Flag_A={'1'},Flag_B={'1'}>}A.TO_BE)>0,'OK','NOK')
IF you have columns in both table which can be used instead of flags you can do that do.
I have adjusted my code as instructed. When I add the A.TO_BE as Dimension, my table shows all 3 entries. But once I add the Measure, the entry that does not exist in the second table will disappear, instead of remaing in the table and showing 'NOK' as value in the Measure column.
Use this :
if(aggr(Count({<Flag_A={1},Flag_B={1}>}A.TO_BE),[A.TO_BE])>0,'OK','NOK')
The formula produces the expected result.
Many thanks, Gabbar!