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: 
YoussefBelloum
Champion
Champion

Nested if don't work

Hi Community,

I have a problem on this: (listbox)

=if(v_DIVISION='VSDACHBENSCAN' and wildmatch(concat([Company code],','),'*NL*'),

if(match(Division_customer,'D09'),CustomersC))


as you can see, nested if, but resulting to nothing..


the problem is that when I use these 3 conditions separetely, they works as expected:


  • v_DIVISION is declared on the script and the output is : VSDACHBENSCAN

          when I put the variable v_DIVISION in a text object I have this: VSDACHBENSCAN


  • [Company code] give 'NL10' and 'NL11', that's why I used wildmatch(concat([Company code],','),'*NL*')

          when is use this on a textbox: if(wildmatch(concat([Company code],','),'*NL*'),'NL','NOT NL')  I have NL on my textbox


  • For Division_customer, I have a list of Customers = D09 and a list = D07

          when I use this on a listbox, if(match(Division_customer,'D09'),CustomersC) I have the right list of D09 customers.

Why combined together, these conditions don't work ?





13 Replies
sunny_talwar

without doing selections on NL (on that field)

This will work with the above expression....Only CustomersC will be selected and nothing else

without using wildmatch concat..

Why do you not want to use WildMatch, that will help me understand what you are trying to do and may be I can suggest an alternative

YoussefBelloum
Champion
Champion
Author

EDITED

Ok,

on an app, we have a field called A with the following values (A1, A2, A3, A4, A5)

my section access reduces the values to (A1, A2, A3)

after opening the application., my possible values on the field A are: (A1, A2, A3)

without selecting anything, with this expression:

Wildmatch (concat (A, '*2*')

I can tell if I have a value that includes the number '2' in my possible values on the field A.

is there another technique that returns me TRUE for this test? PS: without making selections on the field A

I ask this question because first, I do not want to complicate the expression with AGGR (), since you told me that with CONCAT I have to use AGGR () and second, It is always interesting to learn something new

Thank you

sunny_talwar

Within set analysis it is possible using p() function... but if you want to use the if statement, I am afraid Concat might be the only option

YoussefBelloum
Champion
Champion
Author

Thanks again bro,

I'll try to do it.

Now I know there are two ways to do this.