Hello AIMMS community,
I am trying to create a mapping file to read a JSON file using Data Exchange Library. The JSON file is structured as follows:
Data: {
"CaseTable":
{
"Case": 1,
"Specification": "Specification 1"
},
{
"Case": 2,
"Specification": "Specification 2"
}]’
"PriceTable": n
{
"Contract": "X",
"Specification": "Specification 1",
"Price": 100
},
{
"Contract": "X",
"Specification": "Specification 2",
"Price": 200
}]
}
As can be seen, the JSON file includes two tables: "CaseTable" and "PriceTable". I want to read price from PriceTable and assign it to the Price_Parameter(i_case, i_contract) which is indexed over “Case” and “Contract”. For example the value of this parameter should be 200 if the Case 2 and Contract “X” is selected:
Price_Parameter(2, X)=200.
Case 2 is related to the Specification 2 (according to the CaseTable) and the price for Specification 2 is 200 (according to the PriceTable).
Could you please let me know how can I create a mapping file to read this parameter?