Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Michiel_QV_Fan
Specialist
Specialist

Macro create straight table with loop

Hi, I need to create a straight table from a data source with > 100 columns.

These columns are increasing so I want to automate the process of adding the new columns.

Also these columns need an 'Enable condition'.

Is this possible with a macro and how would the loop look like?

The API guide has the example for creating a straight table so that's not the question. How to loop and add the condition?

Thanks!!

3 Replies
gardenierbi
Creator II
Creator II

You could build up a table in QV script with all variables for your final table. For example a table with 2 fields : field name & condition.

In your macro you could loop to this table and build your final straight table!

Michiel_QV_Fan
Specialist
Specialist
Author

Hi Sander, that sounds like a good plan.

But I'm not sure how to script this.

gardenierbi
Creator II
Creator II

See as example : http://www.qlikblog.at/662/qliktip-23-deleting-fields-loadscript-dynamically/

This script loop through tables and fields. Replace the DELETE FIELD part for a concatenation of the field to your table.