Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Siercito
Partner - Contributor
Partner - Contributor

IF NOT IS NULL doesn't work

Hi experts, I'm trying to load the last 12 months info's and this is not working.

Before this code I have a table "PERIODOS" where I have the periods of my info

Here is the code

SET VUELTAS = 12;

FOR i = 0 TO $(VUELTAS)

LET vPeriodosBuscados = date(PEEK('ULT_PERIODO', i, 'PERIODOS'),'YYYYMM');

SET vFileName = '[lib://DataFiles/DETALLE_ORDENES_(vPeriodosBuscados).qvd]';

LET vFileSize = FileSize($(vNombreArchivo));

IF NOT IsNull(vFileSize) THEN

ORDENES_PERIODO:
LOAD
ID_ORDEN,
ID_CLIENTE,
ID_EMPLEADO,
TRANSPORTE,
AÑO,
MES,
DIA,
FECHA,
COUNT_ID_PRODUCTO_ORD,
ID_REPARTO,
PERIODO,
ID_PRODUCTO,
DESCUENTO,
NRO_LINEA,
COUNT_PRODUCTO_DET,
CANTIDAD,
PRECIO_UNINTARIO,
MONTO_DE_VENTA
FROM [lib://DataFiles/DETALLE_ORDENES_$(vPeriodosBuscados).qvd]
(qvd);
ENDIF

NEXT

 The info doesn't load and the vPeriodosBuscados have the right info when I use the debbug

Labels (2)
1 Solution

Accepted Solutions
Or
MVP
MVP

There also looks to be a dollar sign missing:

SET vFileName = '[lib://DataFiles/DETALLE_ORDENES_$(vPeriodosBuscados).qvd]';

View solution in original post

3 Replies
Or
MVP
MVP

Your code doesn't seem to be setting $(vNombreArchivo) - what's in that variable? That is the one you're testing for filesize...

Siercito
Partner - Contributor
Partner - Contributor
Author

Sorry, it's the same vFileName variable, when I posted I change some of the names to English and I forgot that.

I use the vFileName variable.

LET vFileSize = FileSize($(vFileName));

Or
MVP
MVP

There also looks to be a dollar sign missing:

SET vFileName = '[lib://DataFiles/DETALLE_ORDENES_$(vPeriodosBuscados).qvd]';