Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Can anyone please help me with below
ID Country
AAA USA
BBB London
CCC USA
CCC London
DDD France
DDD Spain
I have 4 sheets one for each country and it should only appear if the ID with the country is selected
Like Sheet USA should appear only when ID AAA is selected.
Sheet USA and London should appear when ID CCC is selected.
Sheet Spain and France should appear when ID DDD is selected.
Can anyone please help me with the expression to use on the sheet show condition?
I’m using if(match(concat(Country,’,’)=‘USA’),1,0) for the sheet USA but it’s not working
Thank in Advance
For Sheet USA, you would use something like this:
=if (WildMatch(GetFieldSelections(ID),'*AAA*','*CCC*'),1,0)
I hope you can do likewise for the other sheets.
Thank you
is there any way we can do without hard coding ID’s , there are soo many ID’s
I’m using if(match(concat(Country,’,’)=‘USA’),1,0) for the sheet USA but it’s not working
Hi @Qlikuser225
To implement conditional hiding for your Qlik Sense sheets without hardcoding the IDs, you can make use of a data-driven approach that dynamically evaluates the conditions based on your data model.
In your Qlik data load script, create a mapping table that associates each ID with its respective Country. For example:
MapIDToCountry:
Mapping Load
ID,
Country
From [YourDataSource];
then use the GetFieldSelections() function to check the selected ID and dynamically retrieve associated Countries using the mapping table.
Define the condition for each sheet based on the dynamic association.
Here's an example of the condition for the "USA" sheet:
=Count({<Country={'USA'}>} Distinct ApplyMap('MapIDToCountry', GetFieldSelections(ID))) > 0
ApplyMap('MapIDToCountry', GetFieldSelections(ID)) dynamically maps the selected ID to its associated country.
Count({<Country={'USA'}>} ...) checks if the mapped country includes "USA."
Generalize for Other Sheets: Replace 'USA' in the expression with the relevant country for each sheet. For example:
For the "London" sheet:
=Count({<Country={'London'}>} Distinct ApplyMap('MapIDToCountry', GetFieldSelections(ID))) > 0
Hello @Qlikuser225
i would try only
=GetFieldSelections(Country)='USA'
it will return -1 when true and will show the sheet
if you will allow more than 1 selection, you can combine it with wildmatch
=wildmatch(GetFieldSelections(Country),'*USA*')
if want it to be visible even if no selection is made, you can try
=wildmatch(concat(Country,', '),'*USA*')
hope this helps.
Best,
help users find answers! Don't forget to mark a solution that worked for you & to smash the like button!
Thank you
Can you pls let me know how does it work for sheet USA and London, when we select ID CCC both USA and sheet London should show up.
i would try only
=GetFieldSelections(ID)='CCC' //(on USA and london sheet)
it will return -1 when true and will show the sheet
if you will allow more than 1 selection, you can combine it with wildmatch
=wildmatch(GetFieldSelections(ID),'*CCC*') //(on USA and london sheet)
if want it to be visible even if no selection is made, you can try
=wildmatch(concat(ID,', '),'*CCC*') //(on USA and london sheet)
hope this helps.
Best,
help users find answers! Don't forget to mark a solution that worked for you & to smash the like button!
Thank You
can you pls let me know is there any way to use countries in the match fucntion but not ID’s, because I have soo many ids and cannot hard code them.
here it goes
if you want the sheet to be available only when single selection is made
=GetFieldSelections(Country)='USA' or GetFieldSelections(Country)='London'
if you will allow more than 1 selection, you can combine it with wildmatch
=wildmatch(GetFieldSelections(Country),'*USA*','*London*')
if want it to be visible even if no selection is made, you can try
=wildmatch(concat(Country,', '),'*USA*','*London*')