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

'Clear' option should select possible values from a field.

Hi All,

I have created a dashboard where there are various charts and filters. I have created a button which clears all the selections and retains only default selections. But , I wanted the 'Clear' option of the application to exhibit similar behavior. Please let me know on how I can achieve this.

Please find the sample attachment . Here, the 'Clear selections' button will clear all the selections made except the 'Location' filter. Please let me know how to have similar behavior for 'Clear' option of the application too.

Thanks in advance!!

Regards,

Rajalakshmi

13 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

One option is to open the dasboard in desktop, make whatever selection state want when the Clear button is pressed, then on the menu click Selections | Set Clear State and save the document.

Now pressing Clear or Clear All will revert to the state you set above.

Footnote: I prefer to design my documents so that this sort of behaviour is not required, as it can be confusing for the users.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

Thank you Jonathan.

My report has multiple tabs. So, If I Set Clear State, it gets applied to all the tabs. Instead, I need to Set Clear state for each tab individually. Please let me know if there is a way to do that .

Thanks in advance!!

Regards,

Rajalakshmi

Sergey_Shuklin
Specialist
Specialist

Hello!

Not sure will it be usefull, but you may be interested with:

Catch the Clear Button Hit

woshua5550
Creator III
Creator III

why not create several buttons with different triggers for each tab you have?

Miguel_Angel_Baeyens

Well, the "Clear" button in the menu always does exactly that: clear all values and the only way of modifying this behavior, as jontydkpi‌ mentioned above, is using the Set Clear State, which applies to the whole document.

If you don't want this behavior, you need to stop using the Clear button, develop your own, and use bookmarks so each page stores its own status, so to say. You have an example of that behavior here.

Anyway, it would be counterintuitive for me if the same button performs two different actions in two different sheets of the same application.

woshua5550
Creator III
Creator III

maybe you can use Macro to achieve this

check this

Sub SetClearState

select case ActiveDocument.GetLayout.ActiveSheetId

case "Document\SH01"

ActiveDocument.Fields("Location").ClearAllButThis

case "Document\SH02"

ActiveDocument.Fields("Customer").ClearAllButThis

end select

ActiveDocument.SetClearState

End Sub

woshua5550
Creator III
Creator III

Macro will be triggered when you switch the tabs

Anonymous
Not applicable
Author

Thanks Miguel.


I am already using a separate button for Clearing the selections and I am worried that the users might use the application provided button.

-Rajalakshmi

Anonymous
Not applicable
Author

Thanks Dave . But as per the rules, I am not allowed to use macro. Thanks for the macro code.