Skip to main content

Hi Community,

 

I am implementing a feature, which needs connection to R. I have the following code, in which I try to give data to R and run a script.

 

dl::DataTables += {'TimeSeries'};
empty DataMap;
DataMap(dl::dt, dl::idn, dl::cn, dl::dn) += data {
    (TimeSeries, 'lg::S_ActivePeriods', 1, 1) : "period",
    (TimeSeries, 'lg::P_TimeSeries', 2, 0) : "demand"
};

MapName := "TimeSeriesMap";
dl::RemoveDataSourceMapping(MapName);
dl::AddDataSourceMapping( MapName, DataMap,
           dl::DependEmpty, dl::TableAttributesEmpty, dl::ColAttributeEmpty );
dl::ExecScript("source('script.r')",MapName,XA);

 

When dl::AddDataSourceMapping runs, I get the following error message: “Unable to obtain identifier handle for column aperiod, lg::S_ActivePeriods] in table eTimeSeriesMap, TimeSeries]. I have checked that DataMap contains the right data.

 

 

Any advice is much appreciated. This is my first question in the community, please, don’t be harsh on me. If any further information is needed, I will gladly give it :)

 

Thanks,

Zsolti

In the meantime, I managed to solve the problem. The data contained in the data map was not in the library interface.


Reply


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

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