Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

EXPORT QVD WITH VALUE OF A VARIABLE

Hello

I have a macro that exports a file QVD with the employee's name
.
Now I want to add the variable VR_MES the file name that returns months and years.

Employee 02 2011.QVD


sub export_Venda


set obj = ActiveDocument.GetSheetObject("CH14")
set val=ActiveDocument.Fields("Employee").GetPossibleValues
FUNCIONARIO = val.Item(i).Text
obj.ExportEx "D:\Desenv\Qvd_Planejamento_Compra\Venda_"&Employee&".qvd", 4
msgbox("Dados exportados com sucesso")

end sub

1 Reply
Miguel_Angel_Baeyens

Hi,

First make sure that the variable stores the date properly, and not the numeric format of QlikView nor decimals (dates with times).

Then add in the macro the lines corresponding to the reading of the variable and the path modification:

Sub export_Venda Set obj = ActiveDocument.GetSheetObject("CH14") Set val = ActiveDocument.Fields("Employee").GetPossibleValues Set vFecha = ActiveDocument.Variables("vDateVariable") vFecha = vFecha.GetContent.String FUNCIONARIO = val.Item(i).Text obj.ExportEx "D:\Desenv\Qvd_Planejamento_Compra\Venda_"&Employee&"_"&vFecha&".qvd", 4 MsgBox("Dados exportados com sucesso") End Sub


Hope that helps.