Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

shanacefaria
New Contributor

Pivot Table Column

How do I add a column into a table that has a formula consisting of the first column minus the second column, making my new column the third column? Essentially I want to create a column that has a formula using pre-existing data, that responds to Qlicksense filters as well. Please let me know, thanks you!

7 Replies
isingh30
Contributor III

Re: Pivot Table Column

Can you share some sample input & output of your requirement?

shanacefaria
New Contributor

Re: Pivot Table Column

For example, I have forecasted revenue in column 1 and actual revenue in column 2. I would like to create a third column that subtracts our actual revenue from our forecasted revenue, however if we filter according to month, I would like the formula to change according to the month/filter as well. Is there any way to insert this column directly with a filter from Qlicksense and not uploading it from a data source.

rittermd
Honored Contributor

Re: Pivot Table Column

I'm not sure that I understand your question.

A filter by default will recalculate your columns based on your choice.  The 3rd column that you want should just be an expression consisting of the code from the first one minus the code from the second one giving you the difference in the 3rd column.

If that is not what you are asking let me know.

m_perreault
Contributor II

Re: Pivot Table Column

You can do the expression in your first column minus your expression in your second column ie.

Sum(ForecastedRevenue)- Sum(ActualRevenue)

or  you could also do column(1) - column(2) but if you switch around your column orders this would obviously change.

shanacefaria
New Contributor

Re: Pivot Table Column

How do you add a column directly into Qlicksense?

shanacefaria
New Contributor

Re: Pivot Table Column

How do you add a column directly into Qlicksense?

markp201
Contributor III

Re: Pivot Table Column

The column headers in your table work the same as fields.  For example

PriceQuantityTotal
[Order Line Price][Order Line Quantity][Price] * [Quantity]

You can use column(1) * column(2) but this is a relative reference.  if you hide a column it affects the column # reference.