Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

marcus_malinow
Valued Contributor 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

Re: Crosstable load with variable number of columns

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
2 Replies

Re: Crosstable load with variable number of columns

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
Valued Contributor III

Re: Crosstable load with variable number of columns

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

Thanks!

Community Browser