Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
geminihzh
Valued Contributor

dose condition works for "Clear Field" action

Hi, all,

I use a trigger to clear a field like below:

For field TestEC, and field TestSName as dimension for table1 with conditional display. I would like to clear the selection of field SName when field TestEC is cleared. I tried to use the "Field Event Triggers" "OnChange" of field TestEC with condtion as below:

=if(GetSelectedCount(TestEC)=0,TestSName)

, but  it dose not work. So I am wondering is it allowed to use condition for Clear Field action?

Actually, the problem is  originally caused by the conditional dimension, I did not know that the conditional dimension as below :

=if(_display='EC',TestEC,

  if (_display='SName', TestSName))

Will have both 'TestEC' and 'TestName' be selected if I only select in TestEC field. I though if I select in 'TestEC', the 'TestSName' should have connected value available, but not selected, but it seems not that case.

As the trigger dose not work, the only solution now i have is to give up to use the conditional dimension, and create separated tables with TestEC and TestSName as dimension. As I have about 10 more tables to create, I am wondering whether  there is better solution to clear the selection in "TestSName".


Attached is my test .qvw file.

Thanks very much

Zhihong

1 Solution

Accepted Solutions

Re: dose condition works for "Clear Field" action

Hi Zhihong, the FieldName_TextBox looks for a string, if you pass a field, it will be converted to the value of that field or in Null() if there are different values.

Try setting the action with:

=if(GetSelectedCount(TestEC)=0,'TestSName')

2 Replies

Re: dose condition works for "Clear Field" action

Hi Zhihong, the FieldName_TextBox looks for a string, if you pass a field, it will be converted to the value of that field or in Null() if there are different values.

Try setting the action with:

=if(GetSelectedCount(TestEC)=0,'TestSName')

geminihzh
Valued Contributor

Re: dose condition works for "Clear Field" action

Hi, Ruben,

Thanks very much for correcting me.

Yes, it works. Great thanks~

Zhihong