Hi,
I want to create a simple set table, from a multi-dimensional set table.
I am trying to get it by mapping, but I only get some values.
What I am doing wrong?
Thanks.
Below my code:
Set
i Table ixj /i1i6 /
ctry Country Codes (ISO 3166 alpha-2) /ctry1ctry2/
CpaxNace /cpa1cpa3, nace1nace3/
Cpa(CpaxNace) /cpa1cpa3/
Nace(CpaxNace) /nace1nace3/
map(ctry,CPAxNACE,i) / (ctry1.cpa1,ctry1.nace1).i1
(ctry1.cpa2,ctry1.nace2).i2
(ctry1.cpa3,ctry1.nace3).i3
(ctry2.cpa1,ctry1.nace1).i4
(ctry2.cpa2,ctry1.nace2).i5
(ctry2.cpa3,ctry1.nace3).i6 /
Alias(i,j);
Table SAM(ctry,cpa,ctry,nace) “Social Accounting Matrix”
ctry1.nace1 ctry1.nace2 ctry1.nace3 ctry2.nace1 ctry2.nace2 ctry2.nace3
ctry1.cpa1 1 2 3 4 5 6
ctry1.cpa2 7 8 9 10 11 12
ctry1.cpa3 13 14 15 16 17 18
ctry2.cpa1 19 20 21 22 23 24
ctry2.cpa2 25 26 27 28 29 30
ctry2.cpa3 31 32 33 34 35 36
;
display SAM;
Parameter Tij(i,j)
;
Tij(i,j) = sum((ctry,cpa,nace)$((map(ctry,cpa,i) and map(ctry,nace,j))),SAM(ctry,cpa,ctry,nace) ) ;
display Tij;
The result that I get:
---- 33 PARAMETER Tij
i1 i2 i3 i4 i5 i6
i1 1.000 2.000 3.000
i2 7.000 8.000 9.000
i3 13.000 14.000 15.000
i4 22.000 23.000 24.000
i5 28.000 29.000 30.000
i6 34.000 35.000 36.000