Skip to main content
Solved

Write a Slice to a Composite Table

  • September 20, 2022
  • 2 replies
  • 69 views

Forum|alt.badge.img+3

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!

Best answer by Chris Kuip

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.

2 replies

Chris Kuip
AIMMSian
Forum|alt.badge.img+7
  • AIMMSian
  • 125 replies
  • Answer
  • September 21, 2022

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.


Forum|alt.badge.img+3
  • Author
  • Enthusiast
  • 12 replies
  • September 21, 2022

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



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

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