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: 
vikasmahajan

Case with when in load in qlikview

Dear all,

I want to load  following statement in Qlikview

   

Field1= Case

               When  DLT = 'ABC'  then PQR

               When DLT =  'CCC'  then PQR

              When DLT = 'DDD'   then  DDD

          End

Field2 ...

Regards

Vikas


Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Pick(Match(DLT, 'ABC', 'CCC', 'DDD'), 'PQR', 'PQR, 'DDD') As Field1

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

4 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Pick(Match(DLT, 'ABC', 'CCC', 'DDD'), 'PQR', 'PQR, 'DDD') As Field1

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable

load

  ...

  if (DLT='ABC' or DLT='CCC', 'PQR', DLT) as Field1,

if you have always different values to compare

load

..

if (DLT='ABC', 'PQR',

   if (DLT='CCC', 'PQR',

      if (DLT='DDD', 'DDD',

        if (DLT=...,                   as Field1

vikasmahajan
Author

Thanks

Works

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
rubenmarin

Also you can maintain a table of correspondece and use applymap

Map_correspondece:

Mapping LOAD * Inline [

Key, Value

ABC, PQR

CCC, PQR

DDD, DDD

];

LOAD ApplyMap('Map_correspondece', DLT, [value_if_not_found]) as Field1

...

The Map_correspondence table can be loaded from any source allowing maintenance outside QV script.