Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

pascos88
Contributor

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

13 Replies
sureshqv
Esteemed Contributor III

Re: Use a values of a column already calculated

store  A and B values in variable    do below

(vValue) - (vSale)

omarbensalem
Esteemed Contributor

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

pascos88
Contributor

Re: Use a values of a column already calculated

Doesn' t work like this...

omarbensalem
Esteemed Contributor

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:

Capture.PNG

agigliotti
Honored Contributor II

Re: Use a values of a column already calculated

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

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

pascos88
Contributor

Re: Use a values of a column already calculated

this is my test, and doesn't work..Column1-2.PNG

simon_minifie
Contributor III

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

pascos88
Contributor

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

simon_minifie
Contributor III

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/col...

Thanks,

Simon