Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
i have multiple files to load in the format 201801, 201802........201812. which consists of required data in different columns eg: Budget and Forecast from 201801 to 201812.
My problem is : how to load the data with from multiple files without changing the script (it should load the latest files as well load old files also). 2. how to create a flag or label that upon selection returns value of the corresponding month. eg: if selection is done as 201804 then it has to return the corresponding values.
cumulative figures should also be available to show
Thanks
Vinay
Hi Vinay,
This is from here - Qlik Sense - Loop through Excel Files and Works... | Qlik Community
Try this:
sub ReadMultipleExcel (Root)
For Each File in filelist (Root&'\*.xlsx')
YourTable:
Load * FROM [$(File)] (ooxml, embedded labels, table is YourSheet)
Next File
End Sub
Call ReadMultipleExcel ('lib://YourFiles')
It will loop through every xlsx file and read it's content.
As far as I get your state, you have same structured files, but other timestamp in filename.
The $(File) variable contains the filename, you can extract the date from it.
G.
you can loop through the files.
If I understand correctly the every file has a new column with the actual data, and retain the previous data as well?
Maybe you need only the last file right?
Can you provide us an example?
I think the crosstable option may help you in this case https://help.qlik.com/en-US/sense/June2018/Subsystems/Hub/Content/LoadData/work-with-cross-tables.ht...
G.
Hi Vinay,
This is from here - Qlik Sense - Loop through Excel Files and Works... | Qlik Community
Try this:
sub ReadMultipleExcel (Root)
For Each File in filelist (Root&'\*.xlsx')
YourTable:
Load * FROM [$(File)] (ooxml, embedded labels, table is YourSheet)
Next File
End Sub
Call ReadMultipleExcel ('lib://YourFiles')
It will loop through every xlsx file and read it's content.
As far as I get your state, you have same structured files, but other timestamp in filename.
The $(File) variable contains the filename, you can extract the date from it.
G.
you can loop through the files.
If I understand correctly the every file has a new column with the actual data, and retain the previous data as well?
Maybe you need only the last file right?
Can you provide us an example?
I think the crosstable option may help you in this case https://help.qlik.com/en-US/sense/June2018/Subsystems/Hub/Content/LoadData/work-with-cross-tables.ht...
G.
Hi Gabor,
I have attached the test files as requested
thank you!
As I see every file contains every column, so the looping through files solve the problem
G.
thanks for the help really appreciated.