Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Highlighted
mrchmchr
New Contributor III

Create generic object containing all fields

Hi everyone,

I am now trying to create a generic object in my mashup that containes all data of the current app.

The background is, that I want to provide a generic data export function independent of the current app and without knowledge of the apps contents.

The export part already works, what I need is a possibility to create an object (or table) containing all fields available in the current app.

I tried the createTable method:

app.createTable(["FirstName", "LastName"], ["Count(Case Id)"],{rows:200});

But I could not figure out how to pass all fileds in the first argument. I also tried createGenericObject but I could not find a comprehensive list of arguments that can be passt to initialProperties or qDimension or qDef.


(By the way, is there such a thing as a comprehensive list of arguments that can be passed to lists or genericObjects? I find the help page / API to be quite verbose and incoherent).


I am glad for any input on both Issues.


Thanks,

Marco

1 Solution

Accepted Solutions
ErikWetterberg
Honored Contributor

Re: Create generic object containing all fields

Hi Marco,

app.getList('FieldList') will get you all fields, but building one table with all fields will only work for very small apps.

Hope this helps

Erik Wetterberg

4 Replies
ErikWetterberg
Honored Contributor

Re: Create generic object containing all fields

Hi Marco,

app.getList('FieldList') will get you all fields, but building one table with all fields will only work for very small apps.

Hope this helps

Erik Wetterberg

mrchmchr
New Contributor III

Re: Create generic object containing all fields

Hi Erik,

thanks for your reply. That is what I was looking for.
Could you by chance tell me something about the limitations you mentioned?
How many fields render an app too "big" to build a table? Is there a better way to export a slice of the dataset (all fields) without previously building an object in the app containing all fields?

Thanks for your help.

ErikWetterberg
Honored Contributor

Re: Create generic object containing all fields

Hi,

The approach of adding all fields to one table would create the cartesian product of all your data rather than recreating the data that was originally loaded.

If you really want to export the original data you would need to create and export one table for each imported table. Tables are described in this structure: TableRecord ‒ Qlik Sense. You can get a list of tables with this call: GetTablesAndKeys method ‒ Qlik Sense.

But Qlik Sense would not add much in this scenario, why not table the original Excel files, output from select statements etc?? And still this might be too much data to really work.

Hope this helps

Erik Wetterberg

mrchmchr
New Contributor III

Re: Create generic object containing all fields

Okay I think I get your point. I should have look at qliks data structure again.

However in my case the database will most likely just consist of one table. I guess I will give this approach a try and see how it will work out.
Thanks for your input on this, you really helped me here.

Best,

Marco