Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Micki
Creator
Creator

Compare values between one column(field) in straight table in UI

Hi folks, 

My table:

Column1Column2
AAdam
AJames
AJames
BMick
BMick
BMick
BJames
BJames
BJames
CAdam
CJames
CMick
CJordan

 

And i want to compare values from Column1 = 'C' with rest Column1 <> 'C'

First data set from main table 

 Distinct 
CAdam
CJames
CMick
CJordan

 

and second dataset from main table which contains distinct values 

Distinct values 
Adam
James
Mick

 

And expected result should be a measure in the same table which should show differences between those two datasets:

 

Difference  Jordan

Thank you in advance !

1 Solution

Accepted Solutions
MayilVahanan

Hi @Micki 

One of the method

Try like below, Create a variable like

vColumn2  =Concat( {<Column1-={'C'}>}DISTINCT Column2,',')

In Straight table,

Dim: Column1, Column2

Exp: If(Index(vColumn2, Column2)=0, Column2)

MayilVahanan_0-1606096015692.png

In text box,

=Concat(Distinct Aggr(If(Index(vColumn2, Column2)=0, Column2), Column1, Column2),',')

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

2 Replies
MayilVahanan

Hi @Micki 

One of the method

Try like below, Create a variable like

vColumn2  =Concat( {<Column1-={'C'}>}DISTINCT Column2,',')

In Straight table,

Dim: Column1, Column2

Exp: If(Index(vColumn2, Column2)=0, Column2)

MayilVahanan_0-1606096015692.png

In text box,

=Concat(Distinct Aggr(If(Index(vColumn2, Column2)=0, Column2), Column1, Column2),',')

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
PriyankaShivhare
Creator II
Creator II

Hi,

 

Data:
Load Distinct
Column1,
Column2,
if(Match(Column1,'A','B'),Column2)as ColumnAB,
if(Match(Column1,'C'),Column2)as ColumnC;
Load * Inline [
Column1, Column2
A, Adam
A, James
A, James
B, Mick
B, Mick
B, Mick
B, James
B, James
B, James
C, Adam
C, James
C, Mick
C, Jordan];

 

MapTest:
Mapping Load Distinct
ColumnAB as ColumnTest ,
'Match'
Resident Data ;


Test1:
Load
ColumnTest,
ApplyMap('MapTest',ColumnTest,'Not Match') as MatchField;
Load Distinct
ColumnC as ColumnTest
Resident Data ;


Drop Table Data;

Now Separate out the dataset with not match string in ColumnTest

 

Thanks,

Priyanka