Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

avermalla
New Contributor

Nested if with And issue

Hi

I am creating a Calculated Field when uploading data through Data Manager in Qlik Sense

the formula for the calculated field is as follows:

if(FlgtHour<=10,'1st Wave',

If(FlgtHour>10 and FlgtHour<=16,'2nd Wave', 'Final Wave'))

If I don't have the 'and' keyword in the second expression it works - as soon as I incorporate the 'and' it fails.

Does the 'and' not work when creating a calculated filed in Data Manager?

Its driving me ....

Thanks

1 Solution

Accepted Solutions

Re: Nested if with And issue

I would think it should... but you can just do this

If(FlgtHour<=10,'1st Wave',

If(FlgtHour<=16,'2nd Wave', 'Final Wave'))

Because if FlgtHour is less than 10, it will just get picked in 1st Wave, you don't really need to add the first part of the condition

5 Replies

Re: Nested if with And issue

I would think it should... but you can just do this

If(FlgtHour<=10,'1st Wave',

If(FlgtHour<=16,'2nd Wave', 'Final Wave'))

Because if FlgtHour is less than 10, it will just get picked in 1st Wave, you don't really need to add the first part of the condition

avermalla
New Contributor

Re: Nested if with And issue

Hi Sunny

Thanks it did work - however in this case the options were quiet simple - but why is the add not working in Data Upload. It works in all other expressions in the front end its only an issue in 'Data Upload - Calculated field'

Re: Nested if with And issue

In the if statement you posted above, I don't see any problem... would you be able to show us the error message?

luismadriz
Valued Contributor

Re: Nested if with And issue

Hi, I just tried this myself and Arvind is correct, the expression editor when creating a calculated field via Data Manager is limited and very controlled. The interface is a bit different to the expression editors we have in Qlik Sense. I tested it on the Cloud so it's the latest version

Whenever I tried to do something simple like IF(C>10 OR C<5,'Yes','No') the expression just didn't work and the ANDs or ORs weren't recognised. 

Strange...

Luis

Re: Nested if with And issue

I was not aware of this new place where you can add this if statement

Community Browser