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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Mazilinho
Contributor III
Contributor III

Pairs creation

Hello guys,

Can someone please help me with the following scenario?

I have 2 fields and i am concatenate them into one, making a pair.

Let's say i have Field 1: Tokyo, London, NY, Paris and Field 2: Berlin, LA, Rome, Rio

When i concatenate them i get: Tokyo-Berlin, Tokyo-LA, Tokyo-Rome and Tokyo-Rio; and Berlin-Tokyo, Berlin-London, Berlin-NY and Berlin-Paris. Since i already have Tokyo-Berlin, i don't want to have the other way, Berlin-Tokyo as a pair. How can i achieve this format?

Thanks!

Labels (1)
2 Replies
EdgarOlmos
Contributor III
Contributor III

Hello.
I think, you are not concatenating the fields, rather, you are doing a Join. To have what you are looking for, what you must do is have an additional field that serves as a point of union between the values.
I attach an example:

EdgarOlmos_0-1663683831766.png

Regards

MarcoWedel

If(Field1 precedes Field2, Field1&'-'&Field2, Field2&'-'&Field1) as ConcatenatedFields