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

Computing Variances using Sum function

I'm attempting to create a column that displays the difference between two columns utilizing the sum function.  I am able to compute successfully as independent expressions, but when attempting to put them in a single expression I render no results.

The expression is written as follows:

(=Sum({$<[BS Date]={"$(=Date(Max([BS Date])))"}>}[Total Adjusted Fair Value]) -

(=Sum({$<[BS Date]={"$(=addyears(Date(Max([BS Date])),-1))"}>}[Total Adjusted Fair Value])

Am I missing something here? 

1 Solution

Accepted Solutions
marcus_malinow
Partner - Specialist III
Partner - Specialist III

Just a syntax error

Your expression needs to lose the first equal signs before the Sum, within the parentheses

=(Sum({$<[BS Date]={"$(=Date(Max([BS Date])))"}>}[Total Adjusted Fair Value]) -

(Sum({$<[BS Date]={"$(=addyears(Date(Max([BS Date])),-1))"}>}[Total Adjusted Fair Value])

View solution in original post

4 Replies
Not applicable
Author

The first line of the expression calculates the Total Adjusted Fair Value for the Date = 12/31/14.  The second line of the expression calculates the Total Adjusted Fair Value for the date one year prior, 12/31/13.

marcus_malinow
Partner - Specialist III
Partner - Specialist III

Just a syntax error

Your expression needs to lose the first equal signs before the Sum, within the parentheses

=(Sum({$<[BS Date]={"$(=Date(Max([BS Date])))"}>}[Total Adjusted Fair Value]) -

(Sum({$<[BS Date]={"$(=addyears(Date(Max([BS Date])),-1))"}>}[Total Adjusted Fair Value])

Not applicable
Author

Marcus,

Thanks, that worked.

marcus_malinow
Partner - Specialist III
Partner - Specialist III

Not a problem, happy to help.

Thanks for marking my answer correct