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

Show column if (date on filter pane)

I try to show columns "Sales 2019", "Sales 2018", etc. I want to show them only if I select the analogical SaleYear. 
I did it in the simplest way, show column if "SaleYear = 2019". It works, but only if I select the one Year.
I tried do this with wildmatch:
if(WildMatch(SaleYear,2019), 1) =1
And again, when I select one Year it works. If I select many Years it doesn't work. 
For example, 
I want to select many years and show as many columns as I choose SaleYears. How can I do that? 

Best Regards, 
Wojciech

4 Replies
Anil_Babu_Samineni

Perhaps this? if(GetSelectedCount(SaleYear)>0, 1,0)
Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
w0jt4z
Contributor III
Contributor III
Author

It's better! Thanks. But now when I select one year it shows all columns with this condition. 
For example, when i select Year 2019, then Qlik shows me all columns, Sales 2019, Sales 2018, etc. 
I have separately measures for the each Year, i added Your condition to each of them and it works like i wrote above. 
Anil_Babu_Samineni

Think normal way like below

For 2019 = if(GetSelectedCount(SaleYear)>0 and SaleYear=2019, 1,0)

For 2018 = if(GetSelectedCount(SaleYear)>0 and SaleYear=2018, 1,0) etc.

If none of them not helps, Can you explain little more with image

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
w0jt4z
Contributor III
Contributor III
Author

It's just the same like at the beginning, when my condition was "show column if "SaleYear = 2019". Doesn't work, when i select more than one Year. 

I will try to explain it more clearly with image.  

First Screenshot shows table, as a dimension i set the months, as a measure i set Sales in individual years (Screenshot 2). 

I try to show columns depending on the choosen SaleYear on filter pane. When I select 2019 - table shows Sales 2019. When I select 2019, 2018, table shows two columns, Sales 2019 and Sales 2018. When I select SaleYear 2019, 2018, 2015, 2014 the table shows 4 columns, Sales 2019, Sales 2018, Sales 2015, Sales 2014, etc.