Page 1 of 1

Loops to fill a table

Posted: Tue Aug 17, 2021 11:51 am
by eviews_5
Hi, I'm trying to fill in a table, "cqestimates" with the code below. When I look at the values in the table it fills each column with the same number. It fills it with the correct value for cell (2,18), but in all of columns instead of just column 18.

Code: Select all

%quarter = "2021Q3" group elements a b c d e f g h i j k l m n o p q for !columns =2 to 18 for !i =1 to elements.@count %val_name = elements.@seriesname(!i) cqestimates(2, !columns) = @elem({%val_name}, %quarter) next next

Re: Loops to fill a table

Posted: Tue Aug 17, 2021 1:51 pm
by EViews Gareth

Code: Select all

for !i =1 to elements.@count %val_name = elements.@seriesname(!i) cqestimates(2, !i) = @elem({%val_name}, %quarter) next

Re: Loops to fill a table

Posted: Wed Aug 18, 2021 8:46 am
by eviews_5
Great, thank you.