Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Table Column Computations

Hi everyone!

I have a problem where in a straight table. I have a new column that is computed through the values of 2 other columns.

Example: Column1 is Sales Gross Margin; Column 2 is Inventory Gross Margin; Column 3 is the difference between Sales and Inventory Gross Margin.

For the initial formula for Column 3, I used the headers: 

[Sales Gross Margin] - [Inventory Gross Margin]  

This formula works. However, the column headers may change depending on which language was selected.  I use FieldValue to get the appropriate translation for "Sales Gross Margin" and "Inventory Gross Margin". However, I can't figure out how what to do so that the formula above would be arbitrary to the current translation. For example: If the current language is Spanish, the formula above would have the Spanish header for "Sales Gross Margin" and "Inventory Gross Margin".

Thanks for all the help!

1 Solution

Accepted Solutions
vgutkovsky
Master II
Master II

Make sure the columns actually exist and are not conditional. Column(2) - column(3) means the 2nd and 3rd expressions that are active.

Vlad

View solution in original post

8 Replies
MayilVahanan

Hi

Try

= Column(2 )- Column(3)

Edit

Sorry, i miss bracket.. Thanks vlad,.

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Hi Mayil,

It didn't work. I think the name of the column headers should be used in the formula.

vgutkovsky
Master II
Master II

Slight change to the above syntax: column(2) - column(3)

Regards,

Vlad

Not applicable
Author

Hi Vlad and Mayil,

It doesn't seem to work. Will column(2) - column(3) still work even if I have certain labels as headers?

MayilVahanan

Hi

Yes, it taken the value from column 2 and column3 and subtract it. It doesn't consider the label of the expression.

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
vgutkovsky
Master II
Master II

Make sure the columns actually exist and are not conditional. Column(2) - column(3) means the 2nd and 3rd expressions that are active.

Vlad

Not applicable
Author

Thanks Mayil and Vlad!

vgutkovsky
Master II
Master II

No problem, please verify correct answer(s).