Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
Can any one please help me to extract date wise qvds and to store qvd with QLIK_DD/MM/YYYY Format.
I have prepared sample excel file for explaining the requirement.
My date field is like DDMMYY Format in database.
The attached excel file contains three dates but in the real environment one qvd contains last 6 months data from this qvd need to extract one qvd for one date and need to store the qvd with date extension.
Please help me to do with for loop. Please find the attached excel file.
expected output:
1. QLIK_09/04/2018.qvd
2. QLIK_10/04/2018.qvd
Thanks in advance
Change the environmental variable to this
SET DateFormat='DD-MM-YYYY';
and then run... I have changed it in the attached file.. can you try to run this now
Try this
Table:
LOAD Date(Date#(Date, 'DDMMYY')) as Date,
prodcuts
FROM [..\..\Downloads\QLIK.xlsx]
(ooxml, embedded labels, table is [Daily extraction]);
FOR i = 1 to FieldValueCount('Date')
LET vDate = FieldValue('Date', $(i));
TempTable:
LOAD Client,
Rank,
Date(Date#(Date, 'DDMMYY')) as Date,
prodcuts
FROM
[..\..\Downloads\QLIK.xlsx]
(ooxml, embedded labels, table is [Daily extraction])
Where Date#(Date, 'DDMMYY') = '$(vDate)';
STORE TempTable into QLIK_$(vDate).qvd (qvd);
DROP Table TempTable;
NEXT
DROP Table Table;
Hi Sunny,
Thanks a lot for your reply.
Sorry I for got to say I am working in Qliksense.
I have copied the same code in Qlik its generating the qvds but getting small issue here.
its generating qvds by creating folders like below please let me know am I missed anything in the store command in the attached app.
and need to generate qvd for each date. In the source have 3 dates but getting only 10 and 11 date qvds there is no 9 date qvd once new dates added for those dates also need to generate qvd.
when I opened 10 folder
The default folder which have given to store qvds is C:\Daily extraction please help me am I missed any thing.
Here I have attached the app also.
Don't use / in file name
Instead of using /, may be use _ or something else to create your date field
Hi Sunny,
Thanks for your reply.
I did n't understand this / Instead of using /, may be use _ or something else to create your date field
could you please highlight in the below code
Table:
LOAD Date(Date#(Date, 'DDMMYY')) as Date,
prodcuts
FROM [lib://daily/QLIK.xlsx]
(ooxml, embedded labels, table is [Daily extraction]);
FOR i = 1 to FieldValueCount('Date')
LET vDate = FieldValue('Date', $(i));
TempTable:
LOAD Client,
Rank,
Date(Date#(Date, 'DDMMYY')) as Date,
prodcuts
FROM [lib://daily/QLIK.xlsx]
(ooxml, embedded labels, table is [Daily extraction])
Where Date#(Date, 'DDMMYY') = '$(vDate)';
STORE TempTable into [lib://daily/QLIK_$(vDate).qvd](qvd);
DROP Table TempTable;
NEXT
Change the environmental variable to this
SET DateFormat='DD-MM-YYYY';
and then run... I have changed it in the attached file.. can you try to run this now