Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
MassicotPSCU
Contributor III
Contributor III

Set Analysis for Sales Data

Hi,

I have sales data table, where records are added for the dollar amount of sales for each representative by year.  In that table I also have a field that can determine if the year in the year field, is the current year.

 I'm trying to write an expression to get the sum of sales not only for the current year, but also for each representative. I'm using set analysis to only get the sum of sales for the current year but there's one problem.  Essentially, I have a filter pane for the different years and I do not want the data to change if I use that filter. This part works fine. However, I also have a filter pane for representative, in which I do want the data to change if I use that filter. With my current expression, the data does not change if I select an individual representative in the filter pane.  I need it to not only show me the sum of sales for the entire current year, but also for each individual representative if selected.

Here's my sample data, as well as the expression I wrote so far. How can I incorporate representative into this expression?

sum({1<CurrentYear={"1"}>}distinct(sales))

Labels (2)
1 Solution

Accepted Solutions
Lisa_P
Employee
Employee

Just change to the $ to allow selections in other fields:

sum({$<CurrentYear={1}>}distinct(Sales))

 

View solution in original post

2 Replies
Lisa_P
Employee
Employee

Just change to the $ to allow selections in other fields:

sum({$<CurrentYear={1}>}distinct(Sales))

 

MassicotPSCU
Contributor III
Contributor III
Author

Thank you so much!