Skip to main content
Question

Importing scalar parameters using dex

  • 30 August 2024
  • 2 replies
  • 26 views

I have an excel file with many spreadsheets. Almost all of them have tabular data information. But one of them has information like the image below. I read the documentation I found about dex, but I couldn't find out if it is possible to import using this format and how to do it.

 

 

Dear @erika.hashiguti 

 

You can achieve this by doing:

<?xml version="1.0"?>
<AimmsExcelMapping>
    <ExcelSheetMapping name="params">
        <RowMapping>
            <ColumnMapping name="param1" maps-to="p_param1" />
            <ColumnMapping name="p_param2" maps-to="p_param2" />
        </RowMapping>
    </ExcelSheetMapping>
</AimmsExcelMapping>
 

 

But, it will read from columns not rows like this:

 

 

Bonus, when I want to find something out like this, I “reverse engineer it”, that is, I create a project and allow DEX to generate the mapping for me. Like this:

 

Procedure pr_generateAndExport {
    Body: {
        dex::GenerateDatasetMappings;
        dex::ReadAllMappings;
        dex::WriteToFile("test.xlsx", "Generated/data-Excel",1);
    }
}


Section importexporttest {
    dex::Dataset: data;
    dex::TableName: params;
    Parameter p_param1 {
        dex::ColumnName: param1;
    }
    Parameter p_param2;
}
 

 

Does this help?


Hi Luis,

 

Thank you, but I already knew how to import using the column mapping. My question was related to the possibility of importing in row mapping. I understand from your answer that only the column mapping is possible.


Reply


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

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