Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
kerkying
Partner Ambassador Alumni
Partner Ambassador Alumni

Ad Hoc Filter using $Field and List Box referencing variable

Hi all,

We are implementing Qlikview server and in our ad hoc reporting solution want to allow filtering from a list of fields.

We cannot place multiple list boxes for each field as there are too many fields.

Currently thinking of displaying all the fields with a list box showing $Field and having a variable vAdHocFilter to store the field name selected from the list box.

We then have another List Box that has a field expression =vAdHocFilter but the listbox does not recognize the value in vAdHocFilter as a field.

Any ideas to make this work?

Thanks!!

1 Solution

Accepted Solutions
trdandamudi
Master II
Master II

The other option that you can try based on your question:


"We then have another List Box that has a field expression =vAdHocFilter but the listbox does not recognize the value in vAdHocFilter as a field. "


In the field expression type =$(=vAdHocFilter)

          OR

In the field expression type =$'(=vAdHocFilter)'

          OR

In the field expression type =$'(vAdHocFilter)'


Note: Assuming that you defined your variable vAdHocFilter =GetFieldSelections($Field)



Hope this helps....


View solution in original post

6 Replies
trdandamudi
Master II
Master II

Might be you can do as follow:

1) Create a list box and select expression and type =$Field     <--- You will see all the fields in data model in this list

2) Create a second list box and select expression and type  =GetFieldSelections($Field)  <-- It will show the field selected in the first list box.

Hope this helps...

trdandamudi
Master II
Master II

The other option that you can try based on your question:


"We then have another List Box that has a field expression =vAdHocFilter but the listbox does not recognize the value in vAdHocFilter as a field. "


In the field expression type =$(=vAdHocFilter)

          OR

In the field expression type =$'(=vAdHocFilter)'

          OR

In the field expression type =$'(vAdHocFilter)'


Note: Assuming that you defined your variable vAdHocFilter =GetFieldSelections($Field)



Hope this helps....


sunny_talwar

Or you can do Aggr($Field, $Field) for your second list box. What if I may, what is the purpose of your second list box? Will you be making further selections in the second list box or is this just to display what is selected?

kerkying
Partner Ambassador Alumni
Partner Ambassador Alumni
Author

Hi Dandamudi,

Thanks for the suggestion - its close but we want to still be able to make selections for the values of the selected field in the second list box. The =GetFieldSelections($Field) only displays the selected field, not showing the values in it.

capture2.PNG

kerkying
Partner Ambassador Alumni
Partner Ambassador Alumni
Author

Hi Sunny,

I wanted to still be able to list the values within the field in my second list box.

I think above comment by Dandamundi seems to be able to make it work - using a variable vAdHocFilter =GetFieldSelections($Field), and In the field expression for the second list box type =$(=vAdHocFilter)

trdandamudi
Master II
Master II

If you want to show the values in the second list box then use the below expression:

=$(=GetFieldSelections( $Field ))

Hope this helps...