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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

column() in expression

In a table (in a graph), i have two expressions, each of them have a calculated label.

In a third expression i use a formula like "=column(1) - column(2)".

If i add a column before the first one, i'll still have "=column(1) - column(2)" in the expression of the last column and that's not what i want.

How may i reference always the same cols (with not fixed but calculated label) in the expression without taking care of the order i set them in the table.

1 Solution

Accepted Solutions
Not applicable
Author

If the column label is calculated, u can still refer to it by name.

Let say the column name is

='Up to ' & var_delay & ' days'

In the expression u can refer to that column using syntax

$(='[Up to ' & var_delay & ' days]')

View solution in original post

9 Replies
sujeetsingh
Master III
Master III

Sorry didnt get you

Not applicable
Author

exemple :

i have a first column with a calculated label.

in another column (i call it TOTAL) i use column(1) to reference it.

If i move the first column in second position, column(1) in TOTAL will still reference the first column of the table.

How can i reference my col so that even if i move it, the reference in TOTAL will still be ok.

(That's a probleme of calculated label i can't use to reference the col)

jagan
Partner - Champion III
Partner - Champion III

Hi,

Just instead of using Column() use Expression label, so even if you change the position of the expression you don't need to change the expression.

For Example:

First Expression:

Expression Label : Total Sales

Expression : = Sum(Sales)

Second Expression:

Expression = [Total Sales] + (Some Calculation)

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

thank's for the answer.

My deal is : how can i do if the column has a calculated label and not a fixed one.

What i realy have in the label is :

='comptes mouv '&$(Annee variable)

Not applicable
Author

If the column label is calculated, u can still refer to it by name.

Let say the column name is

='Up to ' & var_delay & ' days'

In the expression u can refer to that column using syntax

$(='[Up to ' & var_delay & ' days]')

Not applicable
Author

It would be $(='[comptes mouv ' & $(Annee variable)]')

jagan
Partner - Champion III
Partner - Champion III

Hi,

Please find attached file for solution.

Regards,

jagan.

Not applicable
Author

Perfect !!!

Hard to guess 😉

Thank's a lot, it's a huge help.

Not applicable
Author

$(='[comptes mouv ' & $(Annee variable)&']')

to be exact.

But that's it.