Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
rduah4u
Contributor II
Contributor II

CrossTable Function

I previously would executethe below script with a csv file whereby i had to manually delete unnecessary rows to make the script work. However, the csv file is updated daily and i want to prevent manual intervention. When i now run the script i get the below error message: 

The following error occurred:
Generic fields not found.
 
The error occurred here:
tmpdata: Crosstable (Date, NumberofRedemptions, 1) LOAD * FROM [xyz*.csv]

 

Is there a way i can get the below script to work without having to touch the file manually. An example of what the file would look like without any manual intervention is attached. 

tmpdata:
Crosstable (Date, NumberofRedemptions, 1)
LOAD
*
FROM [xyz/*.csv]
;

Data:
NoConcatenate
LOAD
purgechar(" Id", chr(9)) AS StoreID_Data,
num#(Date(Date#(purgechar(Date, chr(9)), 'YYYY-MM-DD'), 'YYYYMMDD')) AS DateKey_Data,
NumberofRedemptions
Resident tmpdata;

Drop Table tmpdata;

DataMapped:
LOAD
ApplyMap('SToSiteMap', ID_Data, Null()) as SKey,
DateKey_Data AS DateKey,
NumberofRedemptions
RESIDENT Data
WHERE DateKey_Data >20240505;
Drop Table Data;

Exit Script;

Labels (1)
0 Replies