Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
nilsgc
Contributor III
Contributor III

Ignoring selection in dimension

Hi,

I have an application containing data for 4 years. Year is a field the user can select - but only one year at a time (Always one selected value).

I know how to use set analysis in expressions to show data from "not selected" years... But, in one chart I would like to show all years as dimension. How do I do that?

Thanks in advance

Nils

1 Solution

Accepted Solutions
johnw
MVP
MVP

Like this, for example:

sum({<Year=>} Sales

Having nothing after the equals sign tells it to IGNORE selections in that field for the purpose of that expression. I believe that as long as you return a value for the Year, like the above would, that using Year as your dimension would give you that Year, even if it is excluded by the selections.

View solution in original post

11 Replies
johnw
MVP
MVP

Like this, for example:

sum({<Year=>} Sales

Having nothing after the equals sign tells it to IGNORE selections in that field for the purpose of that expression. I believe that as long as you return a value for the Year, like the above would, that using Year as your dimension would give you that Year, even if it is excluded by the selections.

View solution in original post

Not applicable

Hi there, you can accomplish this with set analysis, use year as a dimension for the disired chart and use similar expressions to the following:

sum( {$<Year = P({1}) >} Amount)

nilsgc
Contributor III
Contributor III
Author

Hi,

This is correct if I need data from more than one year in EXPRESSION, but I need all years shown as DIMENSION.

Thanks for your quick answer (and to John as well ;-))

Best regards

Nils

johnw
MVP
MVP


nilsGC wrote:but I need all years shown as DIMENSION


Which is exactly what happens if you do what either of us said. See attached.

nilsgc
Contributor III
Contributor III
Author

It works - not completly logical, but it works

Thank you, both 😉

Best regards

Nils

johnw
MVP
MVP

Yeah, I agree. It doesn't really make sense. It seems like we should be doing something with the dimension instead, since that's what we're trying to fix.

Not applicable

Hi Nils, i can't really think on a case where you need a chart with only dimensions and without any aggregation function, what john and I try to say, is that if you use the year as a dimension and you select all the years with set analysis, your chart will display and calculate the expression over all the years in you data model. Perhaps you can be a little more specific on your situation if this does not help you.

Regards

Not applicable

I guessed i typed slower than you guys on my last post. Actually I recommend that you always filter dimension values within set analysis, rather than in the dimension. If you do it with a calculated dimension your ability for sorting will be lost.

Regards

KRS772
Contributor
Contributor

How would you alter this to sum for only the most recent Date period (selected or not)? If you have all years selected but want the sum for only the most recent year?