Hi everyone, I have a problem with the output of a result on an excel sheet. In practice I have x (s, i) as a result of the model and I would like me to output them on excel sheet only that I can’t. The reason is that they are two indices? I am attaching a photo of the lst result of what to bring to excel.
i try like this:
solve portafoglio1 maximizing z using rmip;
display z.l, x.l;
execute_unload “PortfolioComp.gdx”;
execute "gdxxrw PortfolioComp.gdx o=PorioComp.xls par=x rng=foglio1!a1 cdim=1 rdim=1 "
it just doesn’t create any excel sheets for me. In the compiler it gives me this error message:
*** Keyword does not match symbol type, Symbol: x
Any changes made to the spreadsheet were not saved
could someone help me?
GFA
January 19, 2022, 1:26pm
2
Hi RZoro95,
In your GDXXRW-call you are refering to a parameter “x”:
execute "gdxxrw PortfolioComp.gdx o=PorioComp.xls par =x rng=foglio1!a1 cdim=1 rdim=1 "
However, in your model “x” is declared a a variable, hence the error.
To solve this, change par to var:
execute "gdxxrw PortfolioComp.gdx o=PorioComp.xls var =x rng=foglio1!a1 cdim=1 rdim=1 "
Hope this helps.
Regards,
GFA
Hi RZoro95,
In your GDXXRW-call you are refering to a parameter “x”:
execute "gdxxrw PortfolioComp.gdx o=PorioComp.xls par =x rng=foglio1!a1 cdim=1 rdim=1 "
However, in your model “x” is declared a a variable, hence the error.
To solve this, change par to var:
execute "gdxxrw PortfolioComp.gdx o=PorioComp.xls var =x rng=foglio1!a1 cdim=1 rdim=1 "
Hope this helps.
Regards,
GFA
Yeah it worked…thanks a lot Mate !!