Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to export data (conditional) into separate excel files thourgh script

Hi ,

I am working on 9.0 PE & currently stuck at one point.

Our business requirement is such that , we need to provide output in separate excel files whcih inturn will be automatically uploaded to servers using different apllication .

For example :

Our sample output file in qilkview looks like below :

TransNoEmployee
28495530Sam
44155946Sam
22002281Sam
44049134Sam
44260772Mark
21645156Mark
23312382Smith
24255610Smith
28460876Smith


Now i want this output to be exported in different excel files named with "Employee" .

So my output files will be as follow :

File 1 : FileName "Sam"

TransNoEmployee
28495530Sam
44155946Sam
22002281Sam
44049134Sam


File 2 : FileName "Mark"

TransNoEmployee
44260772Mark
21645156Mark


File 3 : FileName "Smith"

TransNoEmployee
23312382Smith
24255610Smith
28460876Smith


Its a real challange for me , as we will be reciveing such work thrice a week with almost 100-125 Employee.

Pls pls help me out in this & i wil be greatful to all of you .

Regards,

Bhushan N

1 Solution

Accepted Solutions
biester
Specialist
Specialist

Hi,

I don't quite understand what you want me to do. But to show how it works I made a full demo with a button to start the macro "Export".

Rgds,
Joachim

View solution in original post

7 Replies
biester
Specialist
Specialist

Hi,

It could be a macro somewhat like this (you'll have to adopt of course):


rem get Possible Employees
set EmpListbox = ActiveDocument.GetSheetObject("LB01")
Emps=EmpListbox.GetPossibleValues
rem go through Employees
for empcounter = lbound(Emps) to ubound(Emps)
rem clear previous selections
ActiveDocument.ClearAll false
rem Select Employee
ActiveDocument.Fields("EMPLOYEES").Select Emps(Empcounter)
rem Compose filename
file="Employee" & Emps(Empcounter) & ".xls"
set Chart2Export = ActiveDocument.GetSheetObject("CH01")
Chart2Export.ExportBiff file
next


Perhaps that helps,

Rgds,
Joachim

Not applicable
Author

Hi biester ,

Thanks for your prompt suggestions.

But i didn't clear at end , how excel file generating with these distinct Employees. I am also try to explore meantime if you got time , requesting you to give some hints .

Thanks,

Bhushan N

biester
Specialist
Specialist

Hi,

I don't quite understand what you want me to do. But to show how it works I made a full demo with a button to start the macro "Export".

Rgds,
Joachim

Not applicable
Author

Hi Joachim ,

During analysing on what you provided , I able to create own script. Your inuts acts as catalyst for me & i am very thankful for you for the same .

Regards,

Bhushan N

Not applicable
Author

Hi.

I suggest you check out this website: www.nprinting.com. They have a product which lets you export data from qlikview docs into excel. You can parse the data so that it is loaded onto different worksheets in Excel according to parameters you set. There's a video which shows how to create a excel report wirh data from QlikView.

You can also request a free trial.

Joseph

camilo
Contributor III
Contributor III

Hi,

I´m trying to generate the xls files with this example but they arent being created, and I dont see (in the macro) the path where those files are supose to be created.

Can someone help me with this example please.

Thanks a lot,

Camilo

hectorgarcia
Partner - Creator III
Partner - Creator III

Hola Camilo,

I just modified this line and worked

file="c:\"&"Employee" & Emps(Empcounter) & ".xls"

I hope it will help you

Hector