Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Is it possible to create a new table (tables) from visualization component and insert/initialize data from visualization code? If there is some example code somewhere it would be excellent help.
(QuickTableViewer component was a great example how to query tables and fields and let user to choose from them. Now I would need a way to create tables and initial data according to users selection).
Hi @KohSamui , not totally clear what are you trying to achieve. Do you want to create a new table with dimensions and measure in it from an extension object?
Hi Alex,
In our case user imports initial data to Qlik normal way using data manager.
But our extension uses initial data to do some automatic analyzing by searching fields from tables and then user confirms that our extension has done correct guesses according to field names. After that our extension reads data from user confirmed fields and extension creates new tables for persisting some data that is calculated inside the extension (because initial data analyze and logic takes time and should be done only once initial data is imported).
So what I need is an example of API usage where extension creates new table with new fields and inserts rows into that table.
Kind Regards
@KohSamui ok, so basically which APIs method to use for create a Qlik visualizations (a table in your example) directly in a Qlik Sense app with dimensions and measures, correct?
Almost but not quite. I try to express myself more clearly:
I need to create data table (into data model) with several columns and add some thousands of data rows - and I need to do that from javascript code in visualization extension. (my code creates the data - it is not imported by user using data manager and csv or db connection).
I know how to read data with qHyperCube but I do not know how to modify and store new data (and how to create empty data table into data model).
@KohSamui that's clear. Basically you are allowing end users to modify reload script, insert new data and then reload data? It's a little bit scary from my point of view. What are you trying to achieve?
Anyway, for doing what you are asking you have to use Engine APIs:
Thank you Alex, this seems a bit complex to me. Sorry, I am new in BI tools and terms and concepts are new to me.
Is this the only way to modify data and datamodel from visualization extension?
Currently our workflow goes like this:
We are currently evaluating our options for implementing this somehow.
Is it so that hyper cube and qlik data model can not be used as a data base? (From visual extension javascript code)
Hyper cube and qlik data model are only for querying data from visualization? Not for writing and modifying?
setScript, doSave and doReload methods seem like a hack for this purpose.
Qlik data model is the "database" of an app, where visualizations get data. Hypercube is an object where you can find data from data model, based on dimension and measures declared in the hypercube itself.
For writing and modifying "database" of an app you have to change or reload the reload script of an app. You can do it manually from Data Load Editor or via API, as mentioned above with setScript, doSave and deReload.
Thank you.
Is there some example code of this kind of database modification?