Solved

"binds-existing" attribute from DEX Library Excel

  • 16 August 2023
  • 3 replies
  • 73 views

Badge +1

 

The binds-existing attribute can be used in conjunction with the binds-to attribute to indicate that, when reading a data file, no new set elements will be created, allowing for a filtering mechanism where a data file can only be partially read for the nodes that correspond to existing set elements in the model.

I have a predefined set named t with valued {1,2,3,4}.

I want to read an Excel file which contains a column named “time” having values (e.g., 0, 5, 6) not included in the previous set, which I do not want to add to set t.

I am specifying the binds-existing attribute in the DEX mapping as follows:

<ColumnMapping name=”time" binds-existing="t" binds-to="t" />

I have not changed the skip-non-existing attribute, so I was expecting that binds-existing attribute would not add the referred values (0, 5, 6) into the predefined set t. However, it still does.

What am I doing wrong? Did I correctly specify the binds-existing attribute?

Thank you very much

 

PS: There are almost no specific examples on using DEX attributes. I’ve looked for in the Documentation, the Community, and the internet.

 


 

icon

Best answer by Joost 21 August 2023, 11:39

View original

3 replies

Userlevel 2
Badge +2

Hi @rmateus , you can specify binds-existing=1, instead of binds-existing=”t” (the binds-to attribute is sufficient for DEX to know how the index is bound). The skip-non-existing attribute you can use with values 0, 1 or 2. Cheers, Joost

Userlevel 2
Badge +2

Hi @rmateus ,

I’m guessing you add this directly in the mapping file?

In that case you need to quote you are right.

Note you can also do this in AIMMS:

dex::ExtraAttributeList( 'indexOfMySet' ) := "binds-existing=1;skip-non-existing=2" ;

Joost

Badge +1

Specifying the binds-existing attribute in the DEX mapping as you suggest:

<ColumnMapping name=”time" binds-existing=1 binds-to="t" />

triggers the following error (and the procedure stops):

AddMapping s_parametersMapping: Unable to parse mapping file Mappings/Generated/s_parameters.xml at location 246: Error parsing element attribute

 

In order to work, I had to specify the argument of the binds-existing attribute between commas as follows:

<ColumnMapping name=”time" binds-existing=”1” binds-to="t" />

 

 Thank you very much for your reply @Joost!

Reply


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

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