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: 
amigo007
Contributor III
Contributor III

Flag for difference between two values

I have one table and I need to create a flag/filter to show the difference between the values in 2 columns for the same row.

My table is in the following format:

IdCountry1Country2
1FinlandPortugal
2GermanyGermany
3MoroccoFinland
4PortugalMorocco

So the flag can have 2 values, e.g. 'Same' and 'Different', i.e. if I click 'Same', only the 2nd row for Germany will be shown. Likewise, if I click 'Different', rows 1, 3 and 4 will be shown.

Any idea?

Thanks in advance.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Or in an list box field expression (from <expression> dialog in field drop down on general tab):

=Aggr(   If(Country1 = Country2, 'Same', 'Different') , Id)

View solution in original post

6 Replies
swuehl
MVP
MVP

LOAD

     Id,

     Country1,

     Country2,

     If(Country1 = Country2, 'Same', 'Different') as Flag

FROM ....;

sunny_talwar

May be like this

LOAD Id,

           Country1,

           Country2,

           If(Country1 = Country2, 'Same', 'Different') as Flag

FROM ...

Anil_Babu_Samineni

May be this?

LOAD Id, Country1, Country2, If(Country1 = Country2, 'Same','Different') as Welcome Inline [

Id, Country1 ,Country2

1, Finland ,Portugal

2, Germany ,Germany

3, Morocco ,Finland

4, Portugal, Morocco

];

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

Or in an list box field expression (from <expression> dialog in field drop down on general tab):

=Aggr(   If(Country1 = Country2, 'Same', 'Different') , Id)

neha_shirsath
Specialist
Specialist

Hi,

Try this-

if(Country1=Country2,'Same','Diff')

Thanks,

Neha

amigo007
Contributor III
Contributor III
Author

Thanks guys for your fast and efficient response.