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

Filter out dimension based on selection

Hello,

I have a straight table where fields Year1 & Month1 are my dimensions. I have a filter with fields Year2 & Month2. What I am trying to show in the table is only values from Month1 field where Year2 filter selection = Year1. In my data model, I load completed month data for current year and the past year. If the filter Year2 is 2018 then my straight table dimension should only show Jan as the only completed month so far, if the filter Year2 is 2017 then my straight table dimension would display all 12 months. Is it possible to do this?

1 Solution

Accepted Solutions
sunny_talwar

May be this

Aggr(Only({<Year1, Year2 = P(Year1)}>} Month2), Month2)

View solution in original post

6 Replies
sunny_talwar

Year1 and Year2 are different fields? or it's just you calling them different names because they are from different objects?

hkapadia
Contributor III
Contributor III
Author

They are different fields

sunny_talwar

May be this

{<Year1, Year2 = p(Year1)>}

hkapadia
Contributor III
Contributor III
Author

I am using Calculated Dimension & I used

=only({<Year1, Year2=P(Year1)} Month2)

as the expression as I only want to show months for the year selected in Year1. This is giving me 'Error in calculated dimension'.

sunny_talwar

May be this

Aggr(Only({<Year1, Year2 = P(Year1)}>} Month2), Month2)

hkapadia
Contributor III
Contributor III
Author

Thanks Sunny. That worked.