Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Script if/And statements

Hi guys

I really hope someone can help me.

I have version 8 of Qlikview and have a document built thats is fed by numerous different excel workbooks.

One of these worksheets is not in the same format as the others so I wish to put an if(and statement ( or the equivilent) within the script so I may build charts etc quickly enough.

This is my condition

if( and([Type of Event] ='Static amendment' ,[Issue held with] = 'Cops Team'), as [If static error is corp ops responsible] = 'Yes')

But Qlikview doent seem to like AND function ,

Can anyone help with the above ?

Thanks

A

1 Solution

Accepted Solutions
Not applicable
Author

The error is coming beacuse of brackets.

Try this:

if([Type of Event] ='Static amendment',if([Issue held with] = 'Cops Team','Yes','No') ) as

[If static error is corp ops responsible]

View solution in original post

8 Replies
Not applicable
Author

Hi,

Syntaxis is not correct, check the documentation:

if(condition1 and condition2, true statement, false statement)

Not applicable
Author

what do you want archive in if  statement?

Not applicable
Author

Try this:

if( [Type of Event] ='Static amendment'  and [Issue held with] = 'Cops Team', [If static error is corp ops responsible] = 'Yes')

or

if( [Type of Event] ='Static amendment'  and [Issue held with] = 'Cops Team', 'Yes','No') as

[If static error is corp ops responsible]

Not applicable
Author

Hi A.Medina

I have tried a few variations, to me it looks like qlikview doesnt like the condition AND,

I have tried to combine my ifs like below:

if([Type of Event] ='Static amendment',if([Issue held with] = 'Cops Team'),'Yes','No') as

[If static error is corp ops responsible]

But I get the following error on the load --

Error in expression:

If takes 2-3 parameters

Can you help please ?

Not applicable
Author

The error is coming beacuse of brackets.

Try this:

if([Type of Event] ='Static amendment',if([Issue held with] = 'Cops Team','Yes','No') ) as

[If static error is corp ops responsible]

Not applicable
Author

Hi Erika

the field name [If static error is corp ops responsible] on this sheet ( its a name in a different Excel workbook) so I think I need to load it AS ,  I think the following works 

if( [Type of Event] ='Static amendment'  and [Issue held with] = 'Cops Team','Yes','No') as  [If static error is corp ops responsible]

Thanks all for your help

Not applicable
Author

Thanks Erika !

Works perfectly!

Not applicable
Author

Bonjour,

J'ai besoin de faire une condition sur un filtre, il doit pas être sélection, pourriez vous m'aider.

Merci d'avance