Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I am new to qlik,
I would like to make a union of two partitioned qvd's for month. My code is as follows:
SALES:
LOAD
"SALES_ID" as ID,
"NAME_SALES",
"LATEST_DATE_CHARGE" AS LATEST_DATE_CHARGE_SALES,
SALES AS TYPE
FROM
test.xls
(biff, embedded labels, table is SALES$);
LET vcurrentdate= num(YearStart(Today()));
DO WHILE vcurrentdate <= Today()
ExportTable:
NOCONCATENATE
LOAD *
RESIDENT SALES
WHERE InMonth(LATEST_DATE_CHARGE_SALES, $(vcurrentdate), 0) = true();
LET vdatestring = Date($(vcurrentdate), 'YYYYYMM');
STORE ExportTable INTO [QVDS\SALES_$(vdatestring).QVD] (qvd);
DROP Table ExportTable;
join (SALES)
PRODUCTS:
LOAD
"ID_PRODUCTS" as ID,
"NAME_PRODUCTS" AS NAME,
"LAST_MODIFIED" AS LAST_MODIFIED_PRODUCTS,
PRODUCTS AS TYPE
FROM
test.xls
(biff, embedded labels, table is PRODUCTS$);
LET vcurrentdate= num(YearStart(Today()));
DO WHILE vcurrentdate <= Today()
ExportTable:
NOCONCATENATE
LOAD *
RESIDENT SALES
WHERE InMonth(LATEST_DATE_CHARGE_SALES, $(vcurrentdate), 0) = true();
LET vdatestring = Date($(vcurrentdate), 'YYYYYMM');
STORE ExportTable INTO [QVDS\SALES_$(vdatestring).QVD] (qvd);
DROP Table ExportTable;
I'm getting an error in the NOCONCATENATE loop, do you know why?
Hi,
Usually when you set, let variables is better to set them at the beginning of the script.
I would move the variable in first line. Check the question mark where it close. Maybe after today().
If that isn't working try to load with the debug method just to see where is the real issue.
I think you are not changing value of this variable anywhere, also It seems you have copy pasted script twice, and could you paste it again.
LET vcurrentdate= num(YearStart(Today()));