Structuring a workfile with non-unique values

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

DBW
Posts: 12
Joined: Wed Jul 24, 2019 3:37 am

Structuring a workfile with non-unique values

Postby DBW » Fri Feb 14, 2025 1:39 pm

Hi there. I’m looking for some help with converting a large panel of data that has non unique date identifies into a set of timeseries.

I can’t post the datafile right now so I’ll describe it as best I can. I have a set of observations, each belongs to a category, has a date attached to it, and a transaction value. I want to create a timeseries of transaction values for each category. All this would be straightforward except that some categories might have more than one transaction on any given date, so I need to sum across those observations.

My second problem is that it’s a really large workflow. Something like 180 categories and 450,000 observations, so I’d prefer not to loop through the observations if I can avoid doing so - particularly as I will have to update the data quite frequently.

Are there any solutions to this, or am I looking at some kind of loop using @uniquevals? Thanks in advance for any advice.

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

Re: Structuring a workfile with non-unique values

Postby EViews Gareth » Fri Feb 14, 2025 2:58 pm

I think you'll need to post an example file

DBW
Posts: 12
Joined: Wed Jul 24, 2019 3:37 am

Re: Structuring a workfile with non-unique values

Postby DBW » Wed Feb 19, 2025 7:33 am

Ok, I've attached part of the data file. Hopefully you can see what I mean now.

I think I could use pageunstack if the dates contained in 'record_dates' were unique to each of the transaction types contained in the alpha series called 'seriesname'. But they're not, so I can't.

Any thoughts?
Attachments
Datafile.wf1
(1.82 MiB) Downloaded 43973 times

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

Re: Structuring a workfile with non-unique values

Postby EViews Gareth » Wed Feb 19, 2025 9:05 am

Something like:

Code: Select all

pagecreate(id, page=page2) seriesname @date(record_date) copy(c=sum) page1\transaction_today_amt page2\* @src record_date seriesname @dest record_date seriesname pageunstack(page=page3) seriesname record_date @ transaction_today_amt
The first line creates a new page with the unique combinations of seriesname and date. The second line copies data from the first page to the second, summing values if there are duplicates. The third unstacks.

DBW
Posts: 12
Joined: Wed Jul 24, 2019 3:37 am

Re: Structuring a workfile with non-unique values

Postby DBW » Mon Feb 24, 2025 2:37 am

Thanks Gareth, this has worked perfectly. Really appreciate the help!


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests