Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

richters
New Contributor III

Sum of numbered columns

Hi all,

is there a possibility to sum up or concat numbered columns?

I implemented a loop which creates columns named like : col_0, col_1, ...col_x

I know the number of created columns by a variable (x).

Does anyone know how to work with a flexible number of columns?

Thank you!

1 Solution

Accepted Solutions

Re: Sum of numbered columns

Maybe something like rangesum($(=concat( 'col_'&ValueLoop(1,x),',')))


talk is cheap, supply exceeds demand
2 Replies

Re: Sum of numbered columns

Maybe something like rangesum($(=concat( 'col_'&ValueLoop(1,x),',')))


talk is cheap, supply exceeds demand
richters
New Contributor III

Re: Sum of numbered columns

I used a construction like this:

LET x = 10;

LET vCols = 'rangesum(col_1' ;

for i = 2 to $(x);

LET vCols = '$(vCols)' & ', col_' & $(i);

next

SET vCols = $(vCols));

Thank you!

Community Browser