Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
simonaubert
Partner - Specialist II
Partner - Specialist II

Display chart only if not selection in each field from Table

Hello all,

Use case : I have to display a chart only when I have no selection at all on each field on a Table. Constraint : the fields in the table can vary.

Here is my solution :

 

In the script

//Initialization variable
LET vAffichageRestitPrevi = '-1'; //always true


//I get all my fields in the table through qvd metatata (easiest way in this case)
TMP_FieldName_MyTable :
LOAD
"FieldName" as "FieldName_MyTable"
FROM [$(v_QLIKMART)MyTable.qvd]
(XmlSimple, table is [QvdTableHeader/Fields/QvdFieldHeader]);

//loop to build my variable
FOR Each a in FieldValueList('FieldName_MyTable')
vAffichageRestitPrevi=vAffichageRestitPrevi & ' and GetSelectedCount('& a &')=0'
NEXT a

//I drop the temporary table
drop table TMP_FieldName_MyTable;

 

Then in the chart/Add-ons/ Data Handling/Calculation condition

:

=$(vAffichageRestitPrevi)

Displayed message :

='Please no selection on MyTable fields'

Bi Consultant (Dataviz & Dataprep) @ Business & Decision
2 Replies
Anil_Babu_Samineni

try to share exact script what you've tried, By seeing your expression in script is not computing since you are not using LET and SET properties.

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
simonaubert
Partner - Specialist II
Partner - Specialist II
Author

Sorry : I have no issue and this works fine. This was just a tip if someone else has the same issue 😉

Bi Consultant (Dataviz & Dataprep) @ Business & Decision