Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I want to create a list box with expression to include or exclude data value of an field.
Field: ABC_COMP
One of the Data Value is : XYZ_2020
List box should have a value: Exclude_XYZ_2020 and when this value is selected in the List box, XYZ_2020 should be excluded from the field ABC_COMP. This way, user should be able to include or exclude XYZ_2020.
I have tried: =if(not match(ABC_COMP,'XYZ_2020'),'Exclude_XYZ_2020')
It is working for exclude but when trying to click on it again to include the data, it is not working.
Please advise.
Thanks in advance.
I found a solution to my requirement .
Add 2 buttons
Exclude: 2 actions a) Select in field b) Select excluded
Include: 1 action- Clear field
Thank you for helping me gain knowledge in other options.
Is it not worth to explore the functionality of Select excluded values option in listbox? Why to make things complicated?
Hi Kush,
Could you please advise on how to achieve this through a button or any other suggestions.
Thank you.
You can create two buttons , Include & Exclude and setup variable values like below
For Include, set the variable value to 1 & for Exclude set it to 2
Now you can create expression in listbox from below option
You can use below expression
=if(vCheck=1,ABC_COMP,aggr(Only({<ABC_COMP-={'XYZ_2020'}>}ABC_COMP),ABC_COMP))
Kush,
I tried your suggestion. Buttons are not working for me. Could you please provide an sample qvw?
Also, if user can include/exclude using the buttons, why do we need list box in this case? Can we do it just using the buttons?
Note: ABC_COMP field has multiple data values. 'XYZ_2020' is just one of the data value.
ABC_COMP is available as a list box in the app. But user wants to include or exclude 'XYZ_2020' with one click and not from the available list box.
Either a list box with value 'XYZ_2020' OR buttons to include/ exclude data value 'XYZ_2020' from field ABC_COMP
Thanks
Also, if user can include/exclude using the buttons, why do we need list box in this case? Can we do it just using the buttons?
Where to you want to include and exclude values then? Please see the attached qvw for clarification
Thanks Kush. This helps.
But, when excluded, it is not showing in the Current selection box that 'XYZ_2020' has been excluded. Something like, 'NOT XYX_2020'
Also, I have noticed that the not associated data values are not being displayed in the list box.
Example: data value 'C' is not associated to the selections in the report. When, I hit on the exclude button, both 'C' and 'XYZ_2020' are getting disappeared from the list box.
Why you want to show 'NOT XYX_2020' in current selection? When you already have button that itself describes that value is excluded. What is exact requirement?
It is needed in Current selection box so that it is clear to users on what selections have been made while they are exporting any objects to excel.
What should happen when user selects 'EXCLUDING XYZ 2020'?