Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Community:
i have a table below loaded in Qlik Sesne, is there any we i can export them to individual excel file by using script
region | country | sales |
aa | a1 | 12 |
bb | b2 | 36 |
cc | v2 | 59 |
dd | g6 | 58 |
i would like to export by region, so each of region get a single excel file, many thanks
Hi, just do it like this
[your_table]:
LOAD "region"
FROM [lib://<your path>]...;
For each region in FieldValueList('region')
Data:
Load
region,country,sales
FROM [lib://<your path>]...
where region='$(region)';
Store Data into [lib://<your path>\<your file name>-'$(region)'.csv] (txt);
Next region
drop table [your_table];
Hi,
You can run the for loop and create CSV for each region, using the Store command.
Regards,
Kaushik Solanki
Script side, i don't think there is a way to store to excel...
You can do it by macro on post reload event or maybe you can store in the script in csv with a statemenet something like that
Store Source into Source_new.txt (txt);
check out this conversation: Store in Excel
Hi Kaushik: would you mind share scrip for loop, thanks
Hi, just do it like this
[your_table]:
LOAD "region"
FROM [lib://<your path>]...;
For each region in FieldValueList('region')
Data:
Load
region,country,sales
FROM [lib://<your path>]...
where region='$(region)';
Store Data into [lib://<your path>\<your file name>-'$(region)'.csv] (txt);
Next region
drop table [your_table];
thanks david, it is work. thanks heaps
I am glad to help you . Please mark response as correct to help allso other users.
Don't forget !
When applicable please mark the appropriate replies as CORRECT https://community.qlik.com/docs/DOC-14806. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.