Failing to Export data from workfile to excel with dates

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

RM_RM
Posts: 13
Joined: Mon Nov 10, 2014 5:17 am

Failing to Export data from workfile to excel with dates

Postby RM_RM » Mon Nov 10, 2014 5:43 am

Hi Team,

I am trying to export a time series data (GDP) from a workfile to an excel. I am using the command wfsave so that I can get the data replaced in an existing excel named "output" in a specific worksheet and specific rows/column. Although, the numbers are getting printed but the corresponding dates are not getting printed.

Command:
wfsave(t=excelxml, mode=update) outputq range="Sheet1!D3" byrow @keep gdp @smpl 2014q1 2015q1

Result in excel:
_date_ 41548 41640 41730 41821 41913 42005
gdp 15916.2 15831.7 16010.4 16150.6 16208.90359 16318.7675

Here instead of 2014q1, it is showing a number 41548. Similarly, for 2014q2 its showing 41640. How can I get the dates mentioned in the first row? Please help

regards, RM

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Failing to Export data from workfile to excel with dates

Postby EViews Gareth » Mon Nov 10, 2014 9:10 am

Could you provide the workfile and excel file?

RM_RM
Posts: 13
Joined: Mon Nov 10, 2014 5:17 am

Re: Failing to Export data from workfile to excel with dates

Postby RM_RM » Mon Nov 10, 2014 11:04 pm

Hi Gareth,

Thanks for your reply and your help. I am attaching the program, the workfile and the excel (final output). The dates (2014q1 and so on) are not getting displayed.

-RM
Attachments
printtoexcel.prg
The program
(325 Bytes) Downloaded 309 times
cqdata.wf1
The workfile
(56.81 KiB) Downloaded 282 times
outputq.xlsx
The excel
(8.08 KiB) Downloaded 333 times

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Failing to Export data from workfile to excel with dates

Postby EViews Gareth » Tue Nov 11, 2014 8:49 am

Its just because you have the formatting of that cell in Excel to show a number. If you change the formatting to show it in date format, you'll see it went in just fine.

RM_RM
Posts: 13
Joined: Mon Nov 10, 2014 5:17 am

Re: Failing to Export data from workfile to excel with dates

Postby RM_RM » Tue Nov 11, 2014 11:06 pm

Oh my! That was it. :D Thank you!


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests