Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

If statement

I am working on an if statement in qlikview to find method of payment based on check number, but i keep getting a syntax error.

Can anyone assist please I am not sure what I am doing wrong.

if

     (left([Check Number],1,)

          1, 'Check',

          7, 'Card',

          8, 'ACH',

          9, 'Wire',

     'Other')

Thank you in advance for any assitance

9 Replies
jwjackso
Specialist III
Specialist III

=If(Left([Check Number],1) = 1,'Check',

   If(Left([Check Number],1) = 7,'Card',

    If(Left([Check Number],1) = 8,'ACH',

     If(Left([Check Number],1) = 9,'Wire','Other'))))

Anonymous
Not applicable
Author

Thank you, it worked

MarcoWedel

another option:

Pick(WildMatch([Check Number],'1*','7*','8*','9*','*'),'Check','Card','ACH', 'Wire','Other')

hope this helps

regards

Marco

MarcoWedel

please close your thread if your question is answered:

Qlik Community Tip: Marking Replies as Correct or Helpful

thanks

regards

Marco

sasiparupudi1
Master III
Master III

Please close this thread by marking a correct answer

Anonymous
Not applicable
Author

Hi Use below code.


If(Left([Check Number],1) = 1,'Check',

  If(Left([Check Number],1) = 7,'Card',

    If(Left([Check Number],1) = 8,'ACH',

    If(Left([Check Number],1) = 9,'Wire','Other'))))



Thanks,

Venkata Sreekanth

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Keep in mind that there are two uses of the IF keyword. There is an IF() function that is to be used in expressions and there is an IF control statement that can be used on the outer statement level and in statement blocks but not inside other statements like LOAD.

The IF() function that you seem to be using must be treated as a regular function that accepts parameters and returns a true/false value. IF() function calls can also be nested like regular function calls, as shown in the many examples in this thread.

Anonymous
Not applicable
Author

HI Marco, how do I close it?

sunny_talwar

Check here to see how to mark correct responses....

Qlik Community Tip: Marking Replies as Correct or Helpful