Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Automatic LOAD from Excel

Hi.

I am loading in Excel data to make a analysis in Qlikview. Please see my loadingscript. I do two loads for each month. This is for 2014-06. Is there possible to somehow make a loadscript that will read the new data on reload?


For example. If i add Spec QLI 1407 4567.xlsx in the Qliklek folder. Can it read it and also add the dummyfield 2014-07 automatic if it placed in folder and reloaded?

Hope you understand my question.

Thanks!

//Erik

LOAD 

     Amount,

     Date(Date,'YYYY-MM-DD') as Date,

     '201406' as DateSheet 

    

FROM

[.....Qliklek\Spec QLI 1406 1234.xlsx]

(ooxml, embedded labels, header is 5 lines, table is [Inv - 1234]);

LOAD 

  F1,

     Amount as Claim,

     Date(Date,'YYYY-MM-DD') as Date,

     '201406' as ClaimSheet 

    

FROM

[.....Qliklek\Spec QLI 1406 1234x.xlsx]

(ooxml, embedded labels, header is 5 lines, table is [Inv - 1234])

2 Replies
maleksafa
Specialist
Specialist

this is a sample code i am using to load all the excel files in a directory

let vDataFile = 'MsData\';

for Each File in FileList('$(vDataFile)*.xls*')

let vFileName = mid('$(File)',index('$(File)','\',-1)+1);

 

  TempWavesResults:

        LOAD

        Left([Loc ID],8) as [BU Code],

        text(if( index([Loc ID],'-') > 0,mid([Loc ID], index([Loc ID],'-') + 1))) as Section,

        Points,

        [Points Of],

        mid('$(vFileName)',2,4) as Year,

        mid('$(vFileName)',index('$(vFileName)','-',-1)+1,2) as Wave,

        mid('$(vFileName)',index('$(vFileName)','-')+1,2) as Season

  FROM

  [$(File)]

  (ooxml, embedded labels, table is Sheet1);

Next

it will loop on all the available files.

Not applicable
Author

change the searchpath to  ..Qliklek\Spec QLI*.xlsx

* = all combinations of filename