Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
AnBe
Contributor II
Contributor II

Using existing columns for further calculation within same straight table

Hi all,

I feel stupid to ask but I can't find out else: I have a straight table with some dimensions at the beginning and after it several calculated columns. I would like to use the calculated columns in several following columns instead of writing the formula over and over again. Example:

 

Region                 Sales        Cost       Margin

South                   1.000        500        =Sales-Cost=500

North                       750        300        =Sales-Cost=450

...                             ...            ...            ...

 

Region is a dimension, Sales is a calculation (sum of amount for several accounts), same for cost. Instead of typing in the sum formula for sales minus the formula for cost I would like just to say as a calculation for the column "Margin" to substract the "Cost" from the "Sales".

In QlikView it was just typing in the name of the columns - in QlikSense I cannot find a solution. I am sure there is a really simple one and I just don't see it.

Your help would be really appreciated, thanks in advance!!!

Cheers,

Andrej

Labels (3)
2 Solutions

Accepted Solutions
RamanaKumarChintalapati
Partner - Creator
Partner - Creator

Hi @AnBe ,


In Qlik Sense we have one feature called master items, there you can calculate the required calculation only once  in master items, you can use it in many charts in entire application.

 

Please go through the link:

https://help.qlik.com/en-US/sense/November2023/Subsystems/Hub/Content/Sense_Hub/Assets/work-with-mas...

 

Thanks!!!

View solution in original post

vinieme12
Champion III
Champion III

it is the same as in Qlikview, you can use [Sales]-[Cost]  note the columns reference must be in square brackets

the best method would be to use variables

vSales = expression for Sales

vCost = expressionfor cost

vMargin = $(vSales) - $(vCost)

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

4 Replies
RamanaKumarChintalapati
Partner - Creator
Partner - Creator

Hi @AnBe ,


In Qlik Sense we have one feature called master items, there you can calculate the required calculation only once  in master items, you can use it in many charts in entire application.

 

Please go through the link:

https://help.qlik.com/en-US/sense/November2023/Subsystems/Hub/Content/Sense_Hub/Assets/work-with-mas...

 

Thanks!!!

vinieme12
Champion III
Champion III

it is the same as in Qlikview, you can use [Sales]-[Cost]  note the columns reference must be in square brackets

the best method would be to use variables

vSales = expression for Sales

vCost = expressionfor cost

vMargin = $(vSales) - $(vCost)

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
AnBe
Contributor II
Contributor II
Author

Thank you RamanaKumarChintalapati!

It is not exactly the answer I was looking for but definetely a more elegant solution. 😉

I tried a lot with the column names and variables but didn't think of master items - probably the easiest way. Thanks again and all the best!

AnBe
Contributor II
Contributor II
Author

Thank you vinieme,

this is exactly the answer I was looking for even though there are better solutions with my problem (master items / variables).

I tried variables but made the mistake to include the "=" into the variable's formula so the result always was the total sum instead of partial sum depending on the dimension.

But now I fixed the error in my head and have 3 different possibilities for my task (2 elegant and 1 okay).

Thanks again and all the best!!