13 Replies Latest reply: Jun 27, 2018 1:50 PM by Bala Bhaskar

# Use a values of a column already calculated

Hi all,

there is a way to use in a formula a value already calculate in another column ?

A               B               C

60            50               10

where C is A-B..

Since both in Column A e B there are big expression behind, and it will be really massive to calculate again for the column C,

there is some way to say in the expression for Column C -->  Column(A) - Column (B)

thanks for any helps

• ###### Re: Use a values of a column already calculated

store  A and B values in variable    do below

(vValue) - (vSale)

• ###### Re: Use a values of a column already calculated

Sure thing,

If you have a table; with 3 columns,

C (column 3 ) could have as an èxpression:

column(1)-column(2)

Try it

• ###### Re: Use a values of a column already calculated

Doesn' t work like this...

• ###### Re: Use a values of a column already calculated

Can u maybe share a screenshot of what u have? and what result you got using this?

Because it works for me:

• ###### Re: Use a values of a column already calculated

let's try using the below expression for column 3:

( column(1) ) - ( column(2) )

• ###### Re: Use a values of a column already calculated

this is my test, and doesn't work..

• ###### Re: Use a values of a column already calculated

Hi Pasquale,

It doesn't look like you're closing your parentheses correctly.

Try:

(column(1)) - (column(2))

Thanks,

Simon

• ###### Re: Use a values of a column already calculated

Hi Simon,

unfortunately the issues is not this one.. I tried and nothing happens.

Are we sure that should work for both QS and QV?

I am using QS

Best

• ###### Re: Use a values of a column already calculated

Hi Pasquale,

Have just had a play around with it, and as per the Qlik documentation, it doesn't work on dimension values, just measures.. Could that be the issue?

"Column() returns the value found in the column corresponding to ColumnNo in a straight table, disregarding dimensions. For example Column(2) returns the value of the second measure column."

https://help.qlik.com/en-US/sense/3.1/Subsystems/Hub/Content/ChartFunctions/InterRecordFunctions/column.htm

Thanks,

Simon

• ###### Re: Use a values of a column already calculated

even just using Cloumn(COLNo) doesn't work at all..

• ###### Re: Use a values of a column already calculated

this is just a table with 1 column.. is a bit strange

• ###### Re: Use a values of a column already calculated

See the image for your reference. Column(0)-Column(1) it won't work.

• ###### Re: Use a values of a column already calculated

Column(1) takes the FIRST MEASURE in ur table; while u're using only 2 DIMENSIONS in ur table.

So it's normal that it does not work