Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
geogou1973
Creator
Creator

Export in excel with script module.

Hello.

I have an issue with an export i'm trying to do and does not work.

I have a script module in a trigger on post reload action that exports an excel file from a chart.

The script is :

Sub ExportFiles

Pathcorp="c:\sales\"

Set corp = ActiveDocument.GetSheetObject("CH01")

If store_id="101" then

corp.ExportBiff Pathcorp & "Sales.xls"

End if

End Sub

The store_id is field.


How can i export only the data for the store "101"

Can anyone help me ?


Thank you in advance

Labels (1)
1 Solution

Accepted Solutions
omyahamburg
Creator II
Creator II

Maybe this works:

replace your if with

ActiveDocument.Fields("store_id").Select "101"


Joerg

View solution in original post

3 Replies
omyahamburg
Creator II
Creator II

Maybe this works:

replace your if with

ActiveDocument.Fields("store_id").Select "101"


Joerg

geogou1973
Creator
Creator
Author

It works.

Thank you very much

Not applicable

Hi,

Try this

Create Variables from UI

1. vPathcorp ---> Your desired path to save the exported excel file

2. vstore_id ---> Your store selection (should always one at a time)

Sub ExportFiles

Set Pathcorp = ActiveDocument.Variables("vPathcorp")
Set store_id = ActiveDocument.Variables("vstore_id")

'Pathcorp="c:\sales\"

Set corp = ActiveDocument.GetSheetObject("CH01")

If store_id.GetContent.String="101" then

corp.ExportBiff Pathcorp.GetContent.String & "Sales.xls"

End if

End Sub