Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Im trying to filter since load with the argument when for just load the lines with 'VIGENTE', but i dont know how use it. This is my sentence:
TablaUnidistintos:
LOAD *,
if("Num CCOBRO"=Previous("Num CCOBRO"),if(ESTADO<Previous(ESTADO),'VIGENTE','NO VIGENTE'),'VIGENTE') as VIGENTE
Resident tablaUnifOrdenada
Where VIGENTE='VIGENTE';
Thanks if you give me a light
Try the change in where condition
TablaUnidistintos:
LOAD *,
if("Num CCOBRO"=Previous("Num CCOBRO"),if(ESTADO<Previous(ESTADO),'VIGENTE','NO VIGENTE'),'VIGENTE') as VIGENTE
Resident tablaUnifOrdenada
Where if("Num CCOBRO"=Previous("Num CCOBRO"),if(ESTADO<Previous(ESTADO),'VIGENTE','NO VIGENTE'),'VIGENTE') ='VIGENTE';
The field VIGENTE is created in your LOAD, it's not part of your input table, so you can't use it as field in your WHERE clause.
But you can use a preceding LOAD that operates on the following LOAD statement, hence VIGENTE is available for filtering:
TablaUnidistintos:
LOAD *
WHERE VIGENTE = 'VIGENTE';
LOAD *,
if("Num CCOBRO"=Previous("Num CCOBRO"),if(ESTADO<Previous(ESTADO),'VIGENTE','NO VIGENTE'),'VIGENTE') as VIGENTE
Resident tablaUnifOrdenada;