Skip to main content
Announcements
See why Qlik was named a Leader in the 2024 Gartner® Magic Quadrant™ for Data Integration Tools for the ninth year in a row: Get the report
cancel
Showing results for 
Search instead for 
Did you mean: 
Frquiroga1995
Contributor II
Contributor II

If a record exists and also is different to... then do this...

Hi !

 

I am not an expert at all with Qlikview, but I have been assigned to solve something:

Let's say I have a database like this (bigger, with way more fields and thousand's of records):

NameMOTIVO_BAJA
PedroPROBLEMAS ECONOMICOS
JuanMIGRACION PROD. P&C
LucasRENOVACION
John 
MartinERROR DE EMISION
Martina 
Agustina 

 

I am creating a table in the front, and for one of the fields, I am trying to create an expression that:

-if MOTIVO_BAJA is not null and also if MOTIVO_BAJA is different than "RENOVACION" or MIGRACION PROD. P&C" then show a number 1...

-And if MOTIVO_BAJA is null or is equal to RENOVACION or MIGRACION PROD. P&C then show a 0.

I tried with this one, but it didn't work:

IF(IsNull(MOTIVO_BAJA),0,IF(MOTIVO_BAJA<>"RENOVACION" or "MIGRACION PROD. P&C"),1,0)

 

Thanks !

Labels (1)
4 Replies
Chanty4u
MVP
MVP

try this

If(Match(MOTIVO_BAJA, 'RENOVACION', '[MIGRACION PROD. P&C]') or If(Len(Trim(MOTIVO_BAJA)) = 0, 1,0)

Chanty4u
MVP
MVP

or try this way

 

if(Match(MOTIVO_BAJA, 'RENOVACION',' [MIGRACION PROD. P&C]','-') ), 1,0)

Frquiroga1995
Contributor II
Contributor II
Author

Hi !

That option worked pretty good: (It was the other way, 0 for renovacion, migracion.., " - ", and 1 for the others.

 

So I wrote it : if(Match(MOTIVO_BAJA, 'RENOVACION',' [MIGRACION PROD. P&C]','-') ), 0,1)

 

Frquiroga1995_0-1606408506621.png

 

The only problem now is that in the cases where MOTIVO_BAJA is null, it shows number 1, and its supposed to show a 0 value. Its not taking it as " - " in the expression script.

 

Do you have any idea why that could be happening ?

 

Thank you so much !

 

 

 

Chanty4u
MVP
MVP

FA37D515-CFA4-4A95-A30F-F7C0C2826224.png