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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

CASE statement in QlikView

Hi,

I was wondering if anyone would be able to help me.  I want to create the following Case statement in QlikView:

CASE WHEN [Account Name] IN ('Hong Kong') THEN 'HK'

WHEN [Account Name] IN ('USA') THEN 'NY'

WHEN [Account Name] IN ('UK') THEN 'LDN'

ELSE 'OTHER'

END

Is this possible to do within QlikView?

Any help would be greatly appreciated.

Many thanks.

Rajiv.

Labels (1)
11 Replies
shikha26
Contributor
Contributor

Hello ,

 

I have few qlikview doubts, last time, Tilak told me that you can help

The doubt is:

 

There is a field  Current_status_cd , it has 5 values (Accepted,Activated,Cancelled,Ready For Activation,Requested).

Screenshot in qlikview:

shikha26_0-1599053862861.png

 

 

I want to create one fields using this field which should contain two values (Brutoo and netto) as a list box

  Brutoo = means all status selected

Netto = means all status excluding cancelled

Brutto:                                                            Netto:

 

shikha26_1-1599053862862.png

 

               

shikha26_2-1599053862863.png

 

 

I am writing if conditions but no conditions is giving expected result.

if(CURRENT_STATUS_CD <> 'Cancelled','Netto'

,if(CURRENT_STATUS_CD = 'Accepted' or CURRENT_STATUS_CD = 'Activated'

or CURRENT_STATUS_CD = 'Ready For Activation' or CURRENT_STATUS_CD = 'Requested' or CURRENT_STATUS_CD = 'Cancelled' ,'Brutto',0)) AS Netto_brutoo_filter

 

But no condition is giving expected result, Requirement is user want whole dashboard to change on netto  and brutto switch.

Please help and let me know, if any platform where I can raise my doubts 

shikha26
Contributor
Contributor

 

The doubt is:

 

There is a field  Current_status_cd , it has 5 values (Accepted,Activated,Cancelled,Ready For Activation,Requested).

Screenshot in qlikview:

shikha26_0-1599056084882.png

 

 

I want to create one fields using this field which should contain two values (Brutoo and netto) as a list box

  Brutoo = means all status selected

Netto = means all status excluding cancelled

Brutto:                                                            Netto:

 

shikha26_1-1599056084885.png

 

               

shikha26_2-1599056084886.png

 

 

I am writing if conditions but no conditions is giving expected result.

if(CURRENT_STATUS_CD <> 'Cancelled','Netto'

,if(CURRENT_STATUS_CD = 'Accepted' or CURRENT_STATUS_CD = 'Activated'

or CURRENT_STATUS_CD = 'Ready For Activation' or CURRENT_STATUS_CD = 'Requested' or CURRENT_STATUS_CD = 'Cancelled' ,'Brutto',0)) AS Netto_brutoo_filter

 

But no condition is giving expected result, Requirement is user want whole dashboard to change on netto  and brutto switch.

Please help and let me know, 

 

Kindly assist.

 

 

Thanks,

Shikha