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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
marcus_malinow
Partner - Specialist III
Partner - Specialist III

Crosstable load with variable number of columns

Hi,

I am loading a crosstable from excel with a pretty typical format. Across the top I have cities, and along the side I have measures. I'd like to be able to write my script in such a way that as new cities are added to the spreadsheet, I don't need to rewrite the load script. Is this possible?

Excel file looks something like this:

LondonDublinToronto
Cash1055
VAT.2.23

Script looks something like:

CrossTable(London, Data)
LOAD F1,
    
London,
    
Dublin,
    
Toronto
FROM .\data.xlsx (ooxml, embedded labels, table is Sheet1);

Thanks,

Marcus

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

If you use * instead of listing the field names it won't matter how many columns there are.


CrossTable(City, Data)
LOAD *
FROM .\data.xlsx (ooxml, embedded labels, table is Sheet1);


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

If you use * instead of listing the field names it won't matter how many columns there are.


CrossTable(City, Data)
LOAD *
FROM .\data.xlsx (ooxml, embedded labels, table is Sheet1);


talk is cheap, supply exceeds demand
marcus_malinow
Partner - Specialist III
Partner - Specialist III
Author

Haha that's great, feel foolish for not just giving that a go earlier.

Thanks!