Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Column Reference with Set Analysis

I've created a line chart to compare activity year over year.  I'm having trouble creating the expression to represent the prior year's data, using set analysis to get the year prior to the selected year.  I have 2 issues:

1) I don't want to aggregate any data, I'm using column references so the data is already aggregated.  (I guess I could use MAX or AVG if necessary to make this work

2) Qlikview doesn't appear to want to allow me to use column references.  I get the red underline indicating a syntax error under the columns I'm trying to reference and no data is returned.

Can anyone help me understand what I need to do differently to make this work?

({$<EmailYear={$(=Max(EmailYear)-1)}>}  [#Unique Open Rate])

6 Replies
marthacano01
Partner - Creator
Partner - Creator


Hi Ashley. Try this:

({$<EmailYear={"=Max(EmailYear)-1)"}>}  [#Unique Open Rate])

 

Not applicable
Author

That doesn't work.  It shows the red underline under the whole expression indicating an error.  When I put MAX or AVG in front of it, then the red underline is only under the column reference. 

marthacano01
Partner - Creator
Partner - Creator

ok, please create a variable:

vYear = max(Y)-1

 

sum ({$<EmailYear = {$(vYear)} >} [#Unique Open Rate]))

marthacano01
Partner - Creator
Partner - Creator

the field "Y" is the field that you selected

MK_QSL
MVP
MVP

Try Something Like below

SUM({<EmailYear = {'$(=Max(EmailYear)-1)'}>}SALE)

Change SUM and SALE as per your required field...

marthacano01
Partner - Creator
Partner - Creator

Ok, you can change content of the variable:

 

vYear = max(EmailYear)-1

sum ({$<EmailYear = {"$(vYear)"} >} SALE)