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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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