Problem with data

Problems with modeling
Post Reply
Posts: 4
Joined: 9 months ago

Problem with data

Post by RZoro95 » 9 months ago

Hi everyone, my name is Matteo. I have a problem or rather I don't know how to proceed with a problem in gams. In practice I have "s" sectors and "i" assets, I have to take the data of a score from an excel sheet where on each sheet there is the score for each i, so they are one-dimensional, while the sectors would be the various sheets. Is there any way to do this?

This is the code i use, but is not good:

k criteri /pe,pbv,roe,roa,roi,il,de/;


s settori /1*8/;

SET i stocks /1*5/;

Parameter KScor(s,i);
$call "gdxxrw KScore.xls par=KScor";
$gdxin KScore.gdx
$load KScor
display KScor;

i attached the image of the excel data.

Posts: 48
Joined: 4 years ago

Re: Problem with data

Post by GFA » 8 months ago

Hi Rzoro95,

Two options I can think of:
1) make a new sheet and add the data of all the sheets into one two-dimensional table. Then you only need to read-in one table.
2) read in data per sheet into seperate parameters (e.g. parameters foglio1(i) ... foglio8(i)) and add them together in GAMS in a two-dimensional parameter (eg. Total(i,"1")=foglio1(i).. etc.)

Make sure to use relevant parameters in your GDXXRW call (see also:


Post Reply