Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

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

Re: Script if/And statements

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]

8 Replies
Not applicable

Script if/And statements

Hi,

Syntaxis is not correct, check the documentation:

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

Not applicable

Script if/And statements

what do you want archive in if  statement?

Not applicable

Re: Script if/And statements

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

Script if/And statements

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

Re: Script if/And statements

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

Script if/And statements

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

Re: Script if/And statements

Thanks Erika !

Works perfectly!

Not applicable

Re: Script if/And statements

Bonjour,

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

Merci d'avance