Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content
Announcements
Gartner® Magic Quadrant™: 15 YEARS A LEADER - GET THE REPORT
cancel
Showing results for 
Search instead for 
Did you mean: 
Qlikuser225
Contributor III
Contributor III

Conditional Hiding Table in Qlik Sense

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

 

 

Labels (5)
9 Replies
pravinboniface
Creator III
Creator III

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.

Qlikuser225
Contributor III
Contributor III
Author

Thank you

 is there any way we can do without hard coding ID’s , there are soo many ID’s

Qlikuser225
Contributor III
Contributor III
Author

I’m using if(match(concat(Country,’,’)=‘USA’),1,0) for the sheet USA but it’s not working 

diegozecchini
Specialist
Specialist

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

RafaelBarrios
Partner - Specialist
Partner - Specialist

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!

Qlikuser225
Contributor III
Contributor III
Author

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.

RafaelBarrios
Partner - Specialist
Partner - Specialist

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!

Qlikuser225
Contributor III
Contributor III
Author

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.

RafaelBarrios
Partner - Specialist
Partner - Specialist

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*')