Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
nekia
Contributor II
Contributor II

How to populate columns of a straight table by using chart level scripting

I have a table which has a lot of columns (90 columns) and need the all columns displayed in a straight table because offering to download its entire data source for people visiting dashboard. Adding them by one by one manually is time consuming task. That's the reason why I'd like to do it by using chart level scripting.

 

Labels (2)
6 Replies
Or
MVP
MVP

What makes you think Chart Level Scripting will make this faster than adding the measures manually? And why is it particularly time-consuming to add 90 measures to a single table?

If anything, for a time-saving measure, I'd look at creating this table using API. But even then, I doubt you'd save any time over doing it manually if it's just the one table.

nekia
Contributor II
Contributor II
Author

Thank you for your response.

I think I need a lot of efforts in the following aspects:

  • Ensure that all columns are configured expectedly on a straight table without any human errors
  • If need to chnage the table name which I configured on a straight table, I need to do all same steps again from scratch

I haven't had an idea using API for this purpose. Thanks. Do you think it's still better way for doing manual steps to achieve my purpose.

Or
MVP
MVP

I've created larger tables in the past (we also have the need to allow users to export every column in the app) and it's never been much of a problem. In particular, if your expressions are simple e.g. Sum(Field), you can use the new Straight Table available from May 2023 version to mass-add your fields rather than doing it manually. Additionally, if it's just a data export requirement, you can often get away with adding the field as a dimension rather than as a measure, which saves time.

Insofar as your bullet points:

* You'd need to make sure configuration is correct using chart level scripting or API, as well. Ultimately you need to be sure the expression is written correctly no matter what method is being used to add it to the table.

* I don't follow why changing the table name requires changing anything else.

nekia
Contributor II
Contributor II
Author

My question is based on the following idea using for-loop to populate column recursively without any knowledge of chart level scripting. If this kind of logic works, I thought it can be simpler approach than manual work.

 

 for i = 0 to (# of data table columns)

   column_name = (retrieve name of column[i])

   add_column(column_name, <data of column[i]>)

 

 

Or
MVP
MVP

If this is all you're trying to do, just use the new Straight Table object to mass-add all the fields to a table as dimension fields. It should take less than a minute to do this, so even if the field names change later, it won't require significant upkeep.

nekia
Contributor II
Contributor II
Author

Ok I'll do further work as following your advice.

Many thanks, Or 🙂