Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Case Statement

Hi all,

I am trying to write a Case statement in Qlikview as follows but I am getting nothing as result.

I am trying to execute in Chart Object Expression.

if(wildmatch([Trnsctn_Code],'*APA*', 'Approved'),

if(wildmatch([Trnsctn_Code],'*APC*', 'Credit'),

if(wildmatch([Trnsctn_Code],'*APP*','Pending',),

'OTHER')))

Please advise me.

7 Replies
Anonymous
Not applicable
Author

I think your closing brackets are misplaced, maybe something more like this :

if(wildmatch([Trnsctn_Code],'*APA*') , 'Approved',

if(wildmatch([Trnsctn_Code],'*APC*') , 'Credit',

if(wildmatch([Trnsctn_Code],'*APP*') ,'Pending',

'OTHER')))

Not applicable
Author

Hi Bill,

Thanks for your Quick response, Its working fine.

Anonymous
Not applicable
Author

Glad you are sorted.

maxgro
MVP
MVP

pick(wildmatch([Trnsctn_Code],

       '*APA*', '*APC*', '*APP*', '*'),

       'Approved','Credit','Pending','OTHER'

  )

sunny_talwar

Instead of marking your own responses as helpful, you should consider marking Bill‌'s response as correct and M G‌‌'s response as helpful.

satishkurra
Specialist II
Specialist II

Hi

Thanks for this.

I assume Pick will give better performance than If (correct me if i'm wrong)

Also can we write the similar statement for the range of values as well?

Some thing like below....

Please respond.

=if(GetSelectedCount(Project) = 0,

    if(Sum(Beneficiaries) <= 50,rgb(255,255,102),

    if(Sum(Beneficiaries) >= 51  and Sum(Beneficiaries) <= 100,rgb(255,255,51),

    if(Sum(Beneficiaries) >= 101 and Sum(Beneficiaries) <= 150,rgb(204,204,0),

    if(Sum(Beneficiaries) >= 151 and Sum(Beneficiaries) <= 200,rgb(102,102,0),

    if(Sum(Beneficiaries) > 200, rgb(51,51,0))))))

MarcoWedel

Hi,

maybe like

Pick(Match(Ceil(Value,50),50,100,150,200),RGB1,RGB2,RGB3,RGB4)

regards

Marco