Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

rajalakb
New Contributor

'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

Tags (1)
13 Replies
MVP
MVP

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

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.

rajalakb
New Contributor

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

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

serj_shu
Valued Contributor

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

Hello!

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

Catch the Clear Button Hit

woshua5550
Contributor III

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

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

MVP
MVP

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

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
Contributor III

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

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
Contributor III

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

Macro will be triggered when you switch the tabs

rajalakb
New Contributor

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

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

rajalakb
New Contributor

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

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