Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to compare 2 rows of same column using SET ANALYSIS ?

Hi,


I am actually trying to see how I can compare 2 different rows of same column in a same table using SET ANALYSIS.

Table1:

Id             Name      PropId

1              JOHN      1000

2              JAKE      1000

3              MIKE      10011

4              AMY       10011



I need to check if 'Propid' column having same value then display 'Name'

for example

=If(   (If(Id=1 , PropId)) = (If(Id=2 , PropId))  , Name)

but it is not working. Please Help!


Thanks in Advance



27 Replies
Anil_Babu_Samineni

Expected output?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable
Author

Hi Anil,

While loading data i am passing Id as 1.

Then i need to display Names in straight table as  --    singnaklong, donlaya, tiwari

( For  Id =1 , prop id is 3211, then display all names whose prop id is 3211)

If i pass id as 4 then display --  rahul, mohammed, najma

If i pass id as 7 then display --  Nina, benny, zhou, rex, stefi

Thanks

Sheela

Anil_Babu_Samineni

Sorry for delay, Busy with work. You may try this?

Aggr(Concat(TOTAL <[Prop ID]> Name,','),[Prop ID])

Capture.PNG

Capture.PNG

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable
Author

Hi Anil,

Thank you so much for your reply!

But i want to pass Id like

If(Id=1, Aggr(Concat(TOTAL<[Prop ID]>Name,','),[Prop ID])

so that it should display only singnaklongdonlaya, tiwari


Is this possible?

And i want to display names in straight table like

singnaklong

donlaya

tiwari

Thanks

Sheela

Anil_Babu_Samineni

What is the Logic Behind to do this? I mean what does the use of Customer? May be this

If(Match(Id,1),Aggr(Concat(TOTAL <[Prop ID]> Name,','),[Prop ID]))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
swuehl
MVP
MVP

Have you tried what I've suggested above? A set expression with p() function, like

=Concat({1<PropId = p({<Id = {1}>})>} DISTINCT Name,', ')


Instead of the hard coded value for Id = 1, you can use a variable you set when loading your data:


=Concat({1<PropId = p({<Id = {$(vIdPassedDuringLOAD)}>}) >} DISTINCT Name,', ')

sasiparupudi1
Master III
Master III

Hi

Like this may be?

Not applicable
Author

Hi Stefan,

It worked. Thank you so much:)

Regards

Sheela