Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good morning,
I have table with 10 fields, one of them named "Mercado". I would like to add to the same table a new filed (the eleventh one) called "grupo_mercado" which would be filled with values according to the values existing in "Mercado".
If Mercado='GEN' OR Mercado='GRA' OR Mercado='LOC' THEN grupo_mercado='C'...
I was not able to script this correctly with the Qlikview help neither with QV reference manual.
Can anybody help me?
Thank you.
keep it into one expression only(multiple ifs)...
IF(MATCH(MER_CODIGO,'GRA','GEN','DIR','GPIÑERO','LOC','LOCMEX','MEX','RECP'),'C',
IF(MATCH(MER_CODIGO,'ESP'),'B','A') AS MER_GRUPO
Hi,
if you are in V11, you can do it under the "condition" field.
Use
if(match(mercado,'GEN',GRA,LOC),'C')and so on ur conditions as grupo_mercado
I wrote this into the load sentence after load the field MER_CODIGO:
IF(MATCH(MER_CODIGO,'GRA','GEN','DIR','GPIÑERO','LOC','LOCMEX','MEX','RECP'),'C') AS MER_GRUPO,
IF(MATCH(MER_CODIGO,'ESP'),'B') AS MER_GRUPO
If this is correct, how could I make to fill the value 'A' for all the rest of records which are not 'B'or 'C' ?
Thank you very much
keep it into one expression only(multiple ifs)...
IF(MATCH(MER_CODIGO,'GRA','GEN','DIR','GPIÑERO','LOC','LOCMEX','MEX','RECP'),'C',
IF(MATCH(MER_CODIGO,'ESP'),'B','A') AS MER_GRUPO
Perfect. Thank you.