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: 
AH
Creator III
Creator III

Using of IF statement

Hi,

I have a requirement like this,

IF the Area is A then Currecny is USD and

IF the Area is others (B,C,D,E.......etc) then currency is GBP

How would i apply this IF statements in a Textbox?

Thanks,

Shan

3 Replies
its_anandrjs
Champion III
Champion III

Hi,

Try this in any list box or the Text object

Load

If( Match(Area,'A'),'USD',

If( Match(Area,'B','C','D','E'),'GBP')) as [Currency Select]

From Source;

In list box

If( Match(Area,'A'),'USD',

If( Match(Area,'B','C','D','E'),'GBP'))

Regards

Anand

MK_QSL
MVP
MVP

Little shorter version

=If( Match(Area,'A'),'USD','GBP')

MarcoWedel

Hi,

one solution could be also:

QlikCommunity_Thread_145826_Pic7.JPG

QlikCommunity_Thread_145826_Pic1.JPG

QlikCommunity_Thread_145826_Pic6.JPG

QlikCommunity_Thread_145826_Pic2.JPG

QlikCommunity_Thread_145826_Pic5.JPG

QlikCommunity_Thread_145826_Pic3.JPG

QlikCommunity_Thread_145826_Pic4.JPG

mapCurrency:

Mapping LOAD * Inline [

Area, Currency

A,USD

B,GBP

C,GBP

D,GBP

E,GBP

];

table1:

LOAD *,

    ApplyMap('mapCurrency', Area) as Currency,

    Ceil(Rand()*100) as fact1,

    Ceil(Rand()*100) as fact2;

LOAD Chr(65+Floor(Rand()*5)) as Area

AutoGenerate 20;

hope this helps

regards

Marco