Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Highlighted
michielvandegoo
Valued Contributor

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
Contributor

Re: Macro create straight table with loop

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!

michielvandegoo
Valued Contributor

Re: Macro create straight table with loop

Hi Sander, that sounds like a good plan.

But I'm not sure how to script this.

gardenierbi
Contributor

Re: Macro create straight table with loop

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.