Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Read about Qlik’s Response to COVID-19 Read the Letter, Join the Group.
Highlighted
Contributor

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

Tags (1)
9 Replies
Highlighted
Valued Contributor

Re: If statement

=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'))))

Highlighted
Contributor

Re: If statement

Thank you, it worked

Highlighted

Re: If statement

another option:

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

hope this helps

regards

Marco

Highlighted

Re: If statement

please close your thread if your question is answered:

Qlik Community Tip: Marking Replies as Correct or Helpful

thanks

regards

Marco

Highlighted
Honored Contributor III

Re: If statement

Please close this thread by marking a correct answer

Highlighted
Valued Contributor

Re: If statement

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

Highlighted

Re: If statement

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.

Highlighted
Contributor

Re: If statement

HI Marco, how do I close it?

Highlighted

Re: If statement

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

Qlik Community Tip: Marking Replies as Correct or Helpful