Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
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

;

Tags (3)
5 Replies
Highlighted
Not applicable

Re: how to list all if()s in one columm

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

Highlighted
Not applicable

Re: how to list all if()s in one columm

its the copy of the script,

im working with sql base in my network..

Highlighted
Not applicable

Re: how to list all if()s in one columm

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.

Highlighted
MVP & Luminary
MVP & Luminary

Re: how to list all if()s in one columm

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

Highlighted
Partner
Partner

Re: how to list all if()s in one columm

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,

...

...