Solved

Write a Slice to a Composite Table

  • 20 September 2022
  • 2 replies
  • 35 views

Hey! I'm trying to export using AXLL and have been able to write single variables and simple composite tables, but can't figure out how to slice a variable. I'm not sure if this is something I haven't learned about Sets or something with WriteCompositeTable.

I want to do this:

my_set := {A(x, ‘Blue’), B(x)}

axll::WriteCompositeTable( 
             IdentifierReference : my_set,
             TopLeftCell : "A1");

It's the ‘Blue’ part that I can't figure out.

Thanks in advance!

icon

Best answer by Chris Kuip 21 September 2022, 08:29

View original

2 replies

Userlevel 4
Badge +7

Hello,

 

The procedure axll::WriteCompositeTable expects as its first argument a subset of AllIdentifiers. The set AllIdentifiers is just the names of the identifiers; it does not include slices. 

A way to get your example to work is to introduce a name for that slice as follows:


Parameter ASlice {

    IndexDomain: x;

    Definition: A(x, 'Blue');

}

 

Now you can assign my_set and use it as follows:

 

my_set := data { ASlice, B } ;

axll::WriteCompositeTable( my_set, "A1" );

 

In the attachment ws.zip you'll find a small example.

I knew it would be simple. Thanks for humoring me!

Reply


Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator