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

How to exclude values appearing in a filter - and still have my data work

I have a dimension [Calendar YearMonth] which is a list of year-months in the format '2020-01, 2020-02, 2020-03' etc. This is in a filter pane to be selected by the user.

I have created a pivot table with two measures. The first measure is simply Sales. The second measure is last year's Sales for the month selected. i.e., if you select '2021-01', the second measure will show the Sales for 2020-01.

This all works. However, I want to limit the filter selection to users, so they can only select certain year-months.. I have found ways of doing this by making an expression in the filter. However, this then causes my second measure to break.

 

Advice welcome, thanks.

 

Labels (1)
2 Replies
Chanty4u
MVP
MVP

Hi

1. Use Calculated dimension or Expression in the filterpane:

Create a new filterpane, and choose 'Expression' from list of fields. Now put

"If(Field=Field1 or Field=Field2, Field) as  New "

your Expression to show only Field1 and Field2 values in the filterpane.

or 

2. Use a new table in the model, linking to the desired field, but with only the values that you want to display. Use this dimension in the filterpane.

rhyseretto
Contributor III
Contributor III
Author

Solution 1 doesn't work for me - this was what I originally tried. Perhaps I am missing something obvious, but custom measures don't seem to be able to reference/call Master Items.

Solution 2 would work though it seems a needlessly long workaround.

Cheers though.