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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to Export text file to Qlikview file location

Hello Friends,

I want to export the file to default location where Qlikviewfile is located i have written a code as following

Sub TabDelimitedTextGroup1                                      

    set obj1 =ActiveDocument.GetSheetObject("CH20")    

    obj1.Export "D:\MYfile\E.A.T 2\Group1\"&Date()&"_"&replace(Time(),":","")&".txt",","

    MsgBox("DataHas Been Transfered")

End Sub

but it works on my machine

I want to set a default location where Qlikview file islocated no matter which machine it is used.

I hope some 1 can help me

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

HI,

    There is a variable in qlikview which stores the path of the application i.e. QvWorkPath

    Use this variable in your macro. Something like this.

   

Sub TabDelimitedTextGroup1 

    Set Var = ActiveDocument.GetVariable("QvWorkPath")                                   

    set obj1 =ActiveDocument.GetSheetObject("CH20")   

    obj1.Export Var.GetContent.String&"\"&Date()&"_"&replace(Time(),":","")&".txt",","

    MsgBox("DataHas Been Transfered")

End Sub

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

3 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

HI,

    There is a variable in qlikview which stores the path of the application i.e. QvWorkPath

    Use this variable in your macro. Something like this.

   

Sub TabDelimitedTextGroup1 

    Set Var = ActiveDocument.GetVariable("QvWorkPath")                                   

    set obj1 =ActiveDocument.GetSheetObject("CH20")   

    obj1.Export Var.GetContent.String&"\"&Date()&"_"&replace(Time(),":","")&".txt",","

    MsgBox("DataHas Been Transfered")

End Sub

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Hi,

use obj1.ServerSideExport instead of Normal Export

Not applicable
Author

Thank you very much Koushik .