Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
vlad_komarov
Partner - Specialist III
Partner - Specialist III

Trigger the flag when item is selected in ListBox

Hello,

I have few charts/tables that are hidden until user selects the specific item in a List Box.

I need to setup a flag which would be set when chart becomes visible or if the List Box selection has been made, but I was not able to find an option to do so.

There is no "On Activate/On Show" action for the chart and there is no "On Select" action for List Box.

I can check if the List Box item value is not null: Analysis='Analysis 1' (where "Analysis" is the field used to populate a List Box), but my problem is that a user might clear the list box before I am checking for the flag (before leaving the page in my case).

Basically I need to setup a flag once user sees the chart and keep this flag intact before page or application is closed.

Any suggestions will be greatly appreciated.

Best Regards,

Vladimir

1 Solution

Accepted Solutions
matt_crowther
Luminary Alumni
Luminary Alumni

Vladimir,

Slightly crazy solution attached.

The image will only appear when 'Pie' has been selected in the listbox, even when Pie is then unselected the image will remain. Until Pie has been selected the image will not appear.

Apologies for the random picture.

In my testing this doesn't work everytime as the OnChange Trigger associated with the 'v_Selected_Control' variable doesn't always fire - this may be a bug with my version of QV - if I go into Variable Overview then start clicking in the listbox it works as expected??

Components are:

OnOpen trigger to reset the v_Amends variable to 0

A variable (v_Selected_Control) with the expression: =if(GetSelectedCount(Item)>0,if(index(concat(Item,', '),'Pie'),1,0),0) so if 'Pie' is selected the result is 1 if not 0 and if nothing is selected it's also 0.

An OnChange Trigger looking at the v_Selected_Control variable that sets v_Amend to be v_Amend+1 each time v_Selected_Control changes.

the Image is conditionally displayed when the expression v_Amends>0

Basically v_Selected_Control only changes from 0 when 'Pie' is first selected and will only increase from there so you're image is displayed until the document is re-opened.

Hope that helps - apologies for the confusing explanation.

All the best,

Matt - Visual Analytics Ltd

Qlikview Design Blog: http://QVdesign.wordpress.com

@QlikviewBI

View solution in original post

2 Replies
matt_crowther
Luminary Alumni
Luminary Alumni

Vladimir,

Slightly crazy solution attached.

The image will only appear when 'Pie' has been selected in the listbox, even when Pie is then unselected the image will remain. Until Pie has been selected the image will not appear.

Apologies for the random picture.

In my testing this doesn't work everytime as the OnChange Trigger associated with the 'v_Selected_Control' variable doesn't always fire - this may be a bug with my version of QV - if I go into Variable Overview then start clicking in the listbox it works as expected??

Components are:

OnOpen trigger to reset the v_Amends variable to 0

A variable (v_Selected_Control) with the expression: =if(GetSelectedCount(Item)>0,if(index(concat(Item,', '),'Pie'),1,0),0) so if 'Pie' is selected the result is 1 if not 0 and if nothing is selected it's also 0.

An OnChange Trigger looking at the v_Selected_Control variable that sets v_Amend to be v_Amend+1 each time v_Selected_Control changes.

the Image is conditionally displayed when the expression v_Amends>0

Basically v_Selected_Control only changes from 0 when 'Pie' is first selected and will only increase from there so you're image is displayed until the document is re-opened.

Hope that helps - apologies for the confusing explanation.

All the best,

Matt - Visual Analytics Ltd

Qlikview Design Blog: http://QVdesign.wordpress.com

@QlikviewBI

vlad_komarov
Partner - Specialist III
Partner - Specialist III
Author

Matt,

Interesting solution and it seems to be working fine in my case.

Thanks for the suggestion.

Best regards,

Vladimir