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: 
Not applicable

how to list all if()s in one columm

Hi, I just get AmountALL, and the other wont show up,

if I delete AmountALL, the other shows up...

Are there rules of ordering this Ifs ?

My intention is to have a LIST with all of that IF()s as ZGr..

Whats wrong?

Here my script..

Load

    If(  ("G_L Account No_"<=479999 and "G_L Account No_">=400000) and Match("Global Dimension 1 Code",'T83400','T83500'),'AmountALL',

    If(  ("G_L Account No_"<=479999 and "G_L Account No_">=400000) and Match("Global Dimension 1 Code",'T83500'), 'Direct',

    If(  ("G_L Account No_"<=479999 and "G_L Account No_">=400000) and Match("Global Dimension 1 Code",'T83400'), 'Other',

    If(  ("G_L Account No_"<=479999 and "G_L Account No_">=400000) and Match("Global Dimension 1 Code",'T83400','T83500') and  Match("Global Dimension 2 Code",'DE702100024','DE702100025','DE702100026'),'Service' ,

    If(  ("G_L Account No_"<=479999 and "G_L Account No_">=400000) and Match("Global Dimension 1 Code",'T83400','T83500') and   WildMatch("Global Dimension 2 Code",'DE7011*'),'Project'

     ))))) as ZGr

;

5 Replies
Not applicable
Author

Maybe you could provide a sample file? Maybe your missing something at the end.

Not applicable
Author

its the copy of the script,

im working with sql base in my network..

Not applicable
Author

I am aware of that - but sometimes its easier with a sample to try to see whats wrong. If you says it works without the first if, then try to debug why it doesnt work.

marcus_sommer

Your first condition matched all possibilities therefor all further conditions couldn't be true. For this you must put your most complex condition at the first if-loop.

Further it seems that you need more then one field to categorize your data - the first three conditions are the same ...

- Marcus

stigchel
Partner - Master
Partner - Master

You can use a crosstable load to multiple tag your values, seperate the ifs (an closed if for each value)

Crosstable(MultiFields, Zgr,1)

Load

ID,

...

...