Hi,
I think I am trying to nest loops, but not successfully :(
This is a simplified version of what I have:
%x = "rd"
%z = "go"
for %j tot p
q_us{%z}{%j}_{%x}.label(S) BEA
for %k gdp private
q_US{%z}{%j}_{%x}.displayname US, GO $2009, {%k}
next
next
Ultimately, I want the label 'source' (S) for 'tot' and 'p' to be the same, but the display name should differ - 'tot' should correspond to 'gdp' and 'p' to 'private'. However, when I run this, 'private' shows up as the display name for both.
Can someone help, please? Thanks!!
Nesting loops
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Nesting loops
You can't do what you want with two loops.
I think I would do it this way:
I think I would do it this way:
Code: Select all
%x = "rd"
%z = "go"
%js = "tot p"
%dnames = "gdp private"
for !j = 1 to @wcount(%js)
%j = @word(%js,!j)
%k = @word(%dnames, !j)
q_us{%z}{%j}_{%x}.label(S) BEA
q_US{%z}{%j}_{%x}.displayname US, GO $2009, {%k}
next
-
ecardamone
- Posts: 40
- Joined: Wed Sep 17, 2014 12:23 pm
Re: Nesting loops
Thank you, Gareth! You are a genius!
Who is online
Users browsing this forum: No registered users and 1 guest
