Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Explain this Set Analysis statement

sum({$<Year = {$(=max(Year))}, Month = {"<=$(=max({<Year={$(=max(Year))}>} Month))>$(=max({<Year={$(=max(Year))}>} Month)-1)"}>}  LineSalesAmount)

Can any one explain this?

1 Solution

Accepted Solutions
swuehl
MVP
MVP

The dollar sign expansions will be replaced by the evaluated expressions, e.g. $(=max(Year)) will be replaced by the max Year value possible in your default set.

Assume you have data for 2014 and 2015 and no selection by the user. Max(Year) will be 2015.

max({<Year={$(=max(Year))}>} Month) will return the max possible Month for the max possible Year, so if you have data for each month in 2014, but only up to November in 2015, you will get 11 (numerical value for November).


So your set expression in this scenario will boil down to:

sum({$<Year = {2015}, Month = {"<=11>10"}>}  LineSalesAmount)


The search in the Month is intended to return a value list of {11}, since there is only one value larger than 10 and smaller equal 11 (assuming integer values for Month).


Not sure if this is what you really want though.

Hope this helps

View solution in original post

2 Replies
swuehl
MVP
MVP

The dollar sign expansions will be replaced by the evaluated expressions, e.g. $(=max(Year)) will be replaced by the max Year value possible in your default set.

Assume you have data for 2014 and 2015 and no selection by the user. Max(Year) will be 2015.

max({<Year={$(=max(Year))}>} Month) will return the max possible Month for the max possible Year, so if you have data for each month in 2014, but only up to November in 2015, you will get 11 (numerical value for November).


So your set expression in this scenario will boil down to:

sum({$<Year = {2015}, Month = {"<=11>10"}>}  LineSalesAmount)


The search in the Month is intended to return a value list of {11}, since there is only one value larger than 10 and smaller equal 11 (assuming integer values for Month).


Not sure if this is what you really want though.

Hope this helps

Not applicable
Author

Thank you. it helps me a lot.