Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Qlik Community,
I've been trying to find this answer to this question, but with no sucess so far.
I have a List Box with several values, and a value that should always be excluded. This is the rule unless I need to generate a table/chart/text box with that information.
In short, it HAS to be there, but always excluded/filtered from same listbox.
However, when the user selects something in that listbox and than disselects, all values in that field are included. I don't want to condition all charts with set analysis, I think it would be easier to make a default state in a List Box.
Meaning if nothing is selected in the listbox, exclude that value.
So I want to use an expression in a List Box. Currently I have
=if(GetSelectedCount(GroupCd) > 1,
GroupCd, GroupCd =-'CONSUMPTION')
Clearly, I have my syntax wrong, and can't, for the life of me, get it to work.
Can you help me?
Thank you,
Mariana.
I don't understand why you don't just permanently exclude that value from the listbox.
The charts are built off the listbox. They are built off the underlying field, which still has all values.
try
=if(GetSelectedCount(GroupCd) > 1,
GroupCd, if (GroupCd<>'CONSUMPTION',GroupCd))
Hi,
That doesn't work. I did exclude the value from the list box, but if I clear the field, the charts go back to including it.
Maybe another solution?
Thank you.
If you want the charts to exclude the value, why not create another field in script that down't include that value:
if (GroupCd<>'CONSUMPTION',GroupCd)) as GroupCdForCharts,
Hi Rudolf,
Thanks for your answer.
I tried your expression, however the result is that when I select a value, and then disselect, the list box excludes CONSUMPTION but includes this value in the charts.
Any other ideas?
Thank you,
Mariana
Hi,
I can try that.
Thank you.
I suppose that you Need to work with set Analysis
or better way: exclude this value while loading your data in script
maybe other way round is better. what for you Need this value?
if so, create another table for selection of this value (might be diffcult due
to syntetic key etc.)
Hi Rudolf,
I agree, it seems easier.
Currently trying to grasp the syntax to exclude it from the script.
Thanks for your help,
Mariana.
Hi Mariana,
Try the following syntax instead:
=if(GetSelectedCount(GroupCd) > 1,
GroupCd, IF(NOT MATCH(GroupCd, 'CONSUMPTION'), GroupCd))
See below for an example:
Thanks,
Camile