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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
robert_mika
Master III
Master III

Difference of two rows

Is  the a way to add an additional row to a table/pivot table?

My challenge is to take difference between two rows

Example below:

Capture.PNG

I need to know the difference between B and A for Mike and John.

Is it possible to do that in a table with expression or only script level?

1 Solution

Accepted Solutions
tresesco
MVP
MVP

May be like attached

View solution in original post

13 Replies
Anonymous
Not applicable

column(2)-column(1)

sunny_talwar

You might be able to use ValueList here, have not tested but usually works with an Island table, but since you showed reluctance for script changes try this:

Pick(ValueList(1, 2), Opportunieties, 'Difference') -> as your dimension

Name

Expression should be something along these lines

Pick(ValueList(1, 2), 'However you would calculate the difference', YourCurrentExpression')

petter
Partner - Champion III
Partner - Champion III

It could be done in this way:

2016-02-26 #2.PNG

2016-02-26 #1.PNG

robert_mika
Master III
Master III
Author

Thanks, Sunny.

Script changes can be an option

I added calcualted dimension but that does not bring any values

Capture.PNG

What I', missing here?

Do you have an example of  this methode?

petter
Partner - Champion III
Partner - Champion III

There is a typo in the expression for John... so the calculation is wrong. It should state John in both Sums of that expression - not mixing John and Mike...

tresesco
MVP
MVP

Is this your real case, i.e. - only two line items would be there in your table? I ask this because, I doubt the alternative approaches would be suggested be dynamic unless you go with script solution. And if you are okay with static solution, let know.

tresesco
MVP
MVP

May be like attached

sunny_talwar

Another one by making changes to tresesco‌'s provided solution.

Capture.PNG

sunny_talwar

Seems like ValueList doesn't work. I added a sample by modifying tresesco's qvw. See if that one seems like a viable solution.

Best,

Sunny