Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
geogou1973
Creator
Creator

Insert the timestamp in the name of an export file from VBScript module

Hello.

I have the following VBScript module.

Can you tell me how can i insert the timestamp in the name of the exported file ?

like SALES_20150210 1605.txt

Sub ExportFiles

pathcorp="\\99.99.999.99\c$\SALES\"

vx=timestamp(now())

set corp = ActiveDocument.GetSheetObject("CH11")

corp.ServerSideExportEx  pathcorp & "SALES_" &vx& ".txt" , ";" , 1

end sub

I have change the setting in the script of the QVW file like below.

SET TimestampFormat='YYYYMMDD hhmm';

but does not work.

Can anyone help me ?

1 Solution

Accepted Solutions
rubenmarin

Hi Gou, I'm not sure if timestamp works, you can use:

vx=Year(Now()) & Right("0" & Month(Now()), 2) & Right("0" & Day(Now()), 2) & " " & Right("0" & Hour(Now()), 2) & Right("0" & Minute(Now()), 2)

View solution in original post

2 Replies
rubenmarin

Hi Gou, I'm not sure if timestamp works, you can use:

vx=Year(Now()) & Right("0" & Month(Now()), 2) & Right("0" & Day(Now()), 2) & " " & Right("0" & Hour(Now()), 2) & Right("0" & Minute(Now()), 2)

View solution in original post

sathishkumar_go
Partner
Partner

Hi,

Create a variable and assign the value date(today()). And pass the variable in the macro.

Regards

Sathish