Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikView forum consolidation is complete. Labels are now required. LEARN ABOUT LABELS
cancel
Showing results for 
Search instead for 
Did you mean: 
javier1070
Contributor II
Contributor II

Condition problem

Good afternoon

I need to collaborate with the following segmentation in qlikview, I did it in excel but there is still no way the expression in the script in qlikview



condition

$desc_genero$ IN ("VACIO") AND $desc_genero$ IN ("VACIO", "DESCGENERORow0") AND $VLR_RECAUDO$ <= 40234.15482708782   as Segmento 1


$desc_genero$ IN ("DESCGENERORow4", "DESCGENERORow2", "DESCGENERORow3", "DESCGENERORow0", "DESCGENERORow1") AND $desc_genero$ IN ("VACIO", "DESCGENERORow0") AND $VLR_RECAUDO$ <= 40234.15482708782 as Segmento2


$desc_genero$ IN ("DESCGENERORow4", "DESCGENERORow2", "DESCGENERORow3", "DESCGENERORow1") AND $VLR_RECAUDO$ <= 40234.15482708782 as Segmento3


$VLR_RECAUDO$ > 40234.15482708782 AND TRUE as Segmento4


The script is as follows:


LOAD ID,

     NOM_RAMO_CON,

     NOM_PRODUCTO,

     NOM_CANAL,

     NOM_SUC_NEG,

     NOM_CLA_POLIZA,

     ECOM_AGEN_NOMBRE,

     TIP_NEG,

     FOR_PAGO,

     VLR_PRIMA,

     VLR_ASEGURADO,

     VLR_RECAUDO

FROM

(txt, codepage is 1252, embedded labels, delimiter is '|', msq);

PNJ:

LOAD ID,

     direccion_trabajo,

     desc_ciudad_trabajo,

     telefono_trabajo,

     desc_act_economica,

     desc_sector_economico,

     desc_rang_ingresos,

     desc_rang_egresos,

     desc_rang_activos,

     desc_rang_pasivos,

     exrc_fecha_act_financiera,

     [TIPO PERSONA],

     exrc_fecha_nacim,

     desc_ciudad_nacim,

     direccion_resid,

     desc_ciudad_resid,

     telefono_residencia,

     desc_profesion,

     desc_vinc_laboral,

     desc_ocupacion,

     exrc_desc_nacionalidad,

     desc_genero

FROM

(txt, codepage is 1252, embedded labels, delimiter is '|', msq);

AGE_TABLE:

LOAD*,

Age(Today(),exrc_fecha_nacim) AS Age,

IF(desc_genero=("VACIO") AND desc_genero=("VACIO", "DESCGENERORow0") AND VLR_RECAUDO <= ('40234.15482708782') as Segmento1

Resident PNJ;

DROP Table PNJ;

1 Reply
Peter_Cammaert

I can only help you with part of the load statement (which only tries to decide on the value of Segmento1).

Is 40234.15482708782 a datetime value? If so, then you can write these conditions as follows:

:

IF ((desc_genero = 'VACIO') AND

     Match(desc_genero, 'VACIO', 'DESCGENERORow0') AND

     (VLR_RECAUDO <= '25/02/2010 3:42:57'), true(), false()) AS Segmento1,

:

The others follow the same expression template.