Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
sujit_nath
Creator III
Creator III

Calculate difference between two rows of list box

I have a column containing 2 values which I am using as a dimension in my pivot table chart.

The chart has one expression. Now I want a third row to be added into that column that will be the difference of second -first row upon calculation.

 

Column1
feild1
feild2
feild2-feild1 (Currently I do not have this feild. I want to add this feild so data will be populated id I use this column1 as dimension)
Labels (1)
2 Solutions

Accepted Solutions
Jesh19
Creator II
Creator II

Try checking the ValueList/ValueLoop concept.

View solution in original post

Kushal_Chawda

Create one inline table in script as below

Load * Inline [
Dim
1
2 ];

 

then in chart add below dimension and measure

Dimension:

=pick(Dim,Column,'Field3')

Measure:

=pick(Dim,sum(Sales),sum({<Column={'Field2'}>}Sales)-sum({<Column={'Field1'}>}Sales))

View solution in original post

5 Replies
gayathridevi24
Contributor III
Contributor III

Hi Sujit,

Could you please provide some examples.

 

 

Jesh19
Creator II
Creator II

Try checking the ValueList/ValueLoop concept.

Kushal_Chawda

Create one inline table in script as below

Load * Inline [
Dim
1
2 ];

 

then in chart add below dimension and measure

Dimension:

=pick(Dim,Column,'Field3')

Measure:

=pick(Dim,sum(Sales),sum({<Column={'Field2'}>}Sales)-sum({<Column={'Field1'}>}Sales))

sujit_nath
Creator III
Creator III
Author

Hi Kush,

Thanks for the solution, I tried with Valuelist though, and this gives me my desired result.

sujit_nath
Creator III
Creator III
Author

i Jesh,

I achieved the solution through this. thanks alot!!