Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME 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