Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I've been trying to add a large amount of columns to a table with the Engine API, since otherwise it would be terribly time consuming and numbing to do manually. Of course, now it has taken maybe more time than if it had been done manually, but maybe I could use this in a future case as well.
So, I have created all the master measures I need programatically (100+) and I can add them in different ways to a table. However, none of the ways I've tried allow me to actually see the measures/dimensions added in the Qlik UI. When I move to edit the sheet, and choose the table, I see no measures/dimensions on the right side "Columns"-box.
I have tried making a table manually and looking at the properties and comparing to the one made with the API. I have made a table in the UI and then added the measures with the API, yet it still doesn't work. I have tried creating a new object, doing it with patches, adding the qType, changing the column orders, adding qInitialDataFetch, looking at the network tab to find out if something's missing, and some other things as well.
At some point I managed to get them on the right side bar but then I couldn't replicate it anymore. If I add only a few, it does seem to work, but when I try adding the whole bunch, it breaks down.
Any ideas what I could try? Is there some property I'm missing? Do I need to add some meta-info to the table-object? Or is this possible to do in the first place?
Hello @rocklog
There's an example on how to do it with dimensions here:
Just adding the basic definition of the measure is fine if you just want to extract data programmatically through the API, but the trick here is to figure out which properties you need to set to make it possible for the client to render the visualization correctly. Those requirements are unfortunately not considered part of the API, so reverse engineering is typically the only option. If you look at the example that @Damien_Villaret linked to, you'll see that there are two such properties that need to be set for a table visualization to be correctly rendered:
But keep in mind that the exact set of properties you'll need will depend on which visualization you use.