# Error reading table precio with table handler amplxl:

**URL:** <https://discuss.ampl.com/t/error-reading-table-precio-with-table-handler-amplxl/1210>\
**Category:** Support\
**Tags:** general, errors-and-messages\
**Created:** [September 13, 2024, 1:42am UTC](https://discuss.ampl.com/t/error-reading-table-precio-with-table-handler-amplxl/1210 "2024-09-13T01:42:14Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Nicolau\_Santos](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.ampl.com/nicolau_santos/32/61_2.png) [@Nicolau\_Santos](https://discuss.ampl.com/u/Nicolau_Santos)\
**Post date:** [September 16, 2024, 8:29pm UTC](https://discuss.ampl.com/t/error-reading-table-precio-with-table-handler-amplxl/1210/5 "2024-09-16T20:29:26Z")

</div>

Hi @Laura_Rodriguez

Thank you for the provided information!

To load data from a table with one indexing set you just need the table declaration and the read command.  
However, when you load data from a table with more than one indexing set, the data from the indexing sets must be loaded before.

In the case of table `precio` you have two indexing sets, `G` and `T`, so you first need to load the data for `G` and `T` and only than you can read table `precio`

```auto
table Tiempo IN "amplxl" "dtu.xlsx" "periods":
	T <- [T];

table Generacion IN "amplxl" "dtu.xlsx" "gen":
	G <- [G], pmax, pmin;

table precio IN "amplxl" "dtu.xlsx" "2D":
	[G, T], po;

read table Tiempo;
read table Generacion;
read table precio;

```

As `precio` is a 2D table you need to put the name `G` on top of the column. From the table declaration amplxl will deduce that the header of the table has elements of `T` and that the parameter that you are reading is `po`.

A quick read to [this](https://discuss.ampl.com/t/amplxl-quick-example/317) post might help understanding how amplxl and 2D tables work. amplxl documentation is available [here](https://plugins.ampl.com/amplxl.html).

Sample files attached [example.zip](https://discuss.ampl.com/uploads/short-url/bPrvzPR6fZEiInVfKuAmaYhEC4j.zip) (9.4 KB) with minor changes but also loading the `prfl` data.

---

_[View the full topic](https://discuss.ampl.com/t/error-reading-table-precio-with-table-handler-amplxl/1210)._
