Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Difference & % difference

Hello,

Can you please help me in getting the correct difference & the % difference of two numbers (column GM 2016; column GM 2017),

I want to obtain the difference only to non 0 number that are present in both columns.

I used "fabs(Sum({$<[Year]={"2016"}>}[Gross Margin Actual Year])) - (Sum({$<[Year]={"2017"}>}[Gross Margin Actual Year]))"

to get the difference as the data in excel is in one column.

Thank you in advance

Sachin

10 Replies
sunny_talwar

Is this the expression you use for GM 16?

fabs(Sum({$<[Year]={"2016"}>}[Gross Margin Actual Year]))

If you are, then you want this, right?

If(GM 16 = 0, GM17, 0)

If this is true, then I would think that one of these expression should work

If(fabs(Sum({$<[Year]={"2016"}>}[Gross Margin Actual Year])) = 0, Sum({$<[Year]={"2017"}>}[Gross Margin Actual Year]), 0)

or this

If(fabs(Sum(TOTAL {$<[Year]={"2016"}>}[Gross Margin Actual Year])) = 0, Sum({$<[Year]={"2017"}>}[Gross Margin Actual Year]), 0)

If this doesn't work still, its time for you to share a sample so that we can see what in the world you are doing