Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
vkozlov
Partner - Creator
Partner - Creator

Comparison of values

Good day, team!

Help me somebody

What method can be used to compare values obtained by the example in Table:

1d5502bf696944a48933bf56aed3987c.png

dimensions:  Year, CompanyName

expression- sum of sales

Need to get the difference of sales amounts for each related period (example: difference between 2008 and 2007; 2009 and 2008 etc.)

There is an idea to build a table with several expressions:

=Sum({<Year={2007}>}LinesalesAmount)

=Sum({<Year={2008}>}LinesalesAmount)

=Sum({<Year={2008}>}LinesalesAmount) - Sum({<Year={2008}>}LinesalesAmount) // difference

etc.

But it seems that the decision irrational because with a large variety of Year - to be a lot of routine work




1 Solution

Accepted Solutions
Not applicable

Maybe try this one:

sum(Value)-Before(sum(Value))

Athough it will work only if Year will be in the columns headers

View solution in original post

3 Replies
oknotsen
Master III
Master III

You could try this:

column(1) - column(2)

May you live in interesting times!
Not applicable

Maybe try this one:

sum(Value)-Before(sum(Value))

Athough it will work only if Year will be in the columns headers

vkozlov
Partner - Creator
Partner - Creator
Author

Thanks!

It works