Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Passing a set of filters in qlikview

Hi all ,

I have this below given requirement to display as a table in the qlikview document with the set of filters passed for filtering the data.

surveyprod ctgcharchar typerate 1rate 2rate 3volume
s1catg 1factor1type 1846100
s1catg 1factor2type2766200
s1catg 1factor3type 3978300
s2catg 1factor1type 1957400
s2catg 1factor2type2977500
s2catg 1factor3type 3989600
s2catg 2factor4type 1747700
s2catg 2factor2type2867800
s2catg 2factor3type 3989900

the filters given on the report are :

1.survey

2.prod ctg

3.char

4. char type

5. range slicer(0-10)

output table displays the following columns

1.survey

2.prod ctg

3.char

4.char type

5.volume

the requirement is that the user must be allowed to pass 6 sets of filter.

set of filters include one from the available 5 filters(survey,prod ctg,char,char type,range slicer value)

OR condition needs to be applied when the filter values are passed.

for example: set1 filters OR set2 filters (output will now diplay the data for both the filters selected in set 1 and set 2 )

as i am new to qlikview , i have no idea how to solve this..

can this be handled by setanalysis ? if not then how can this be handled.

Kinldy help with any supportive expressions.

will be greatfull for any kind of help on this post .

thanks.

50 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Here's a modification of my example that lets you make selections and then add them to the next  filter slot.  Only filter slots that have selections will be applied to the charts.  I have  5 states. I'm rotating through them but you could design the flow any way you want, i.e. add to specific filter etc.

Edit: modified the qvw to use a slider to set the manual index. Much more fun.

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

MarcoWedel

here's the (non functioning!) example using previous selection set identifiers:

QlikCommunity_Thread_294299_Pic4.JPG

QlikCommunity_Thread_294299_Pic9.JPG

QlikCommunity_Thread_294299_Pic10.JPG

Marco

Anonymous
Not applicable
Author

Hi Rob ,

Thanks for the solution, i have implemented the same and seems like this is what wanted.

But just facing one minor issue of displaying all the data before applying any filter in the table. i.e Default selection should be "All" and only when the filters passed the data in the table should get filtered.

i am also working on how to achieve this , meanwhile if you have any idea kindly suggest solution for the same.

Many Thanks

Chandana

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Modify the expression (variable vFilterStates in my example) to include state $ if all the Filtern states are empty.

-Rob

Anonymous
Not applicable
Author

Hi Rob ,

Should i add a new state Filtern ? or modify the variable vFilterStates 's definition ?


can you give me the expression for reference please.


Thanks

swuehl
MVP
MVP

Depends on your designed workflow.

You also have a variable vFilterIndex that you can use:

=

If( vFilterIndex =1, '1',

if(len(GetCurrentSelections('','','',1,'Filter1'))>0, 'Filter1+','')

& if(len(GetCurrentSelections('','','',1,'Filter2'))>0, 'Filter2+','')

& if(len(GetCurrentSelections('','','',1,'Filter3'))>0, 'Filter3+','')

& if(len(GetCurrentSelections('','','',1,'Filter4'))>0, 'Filter4+','')

& if(len(GetCurrentSelections('','','',1,'Filter5'))>0, 'Filter5+','')

& '0'

)

Anonymous
Not applicable
Author

Hi Stefan,

Thanks for the response , i modified the expression as given below: (found this in another question in the community):

= If( len(GetCurrentSelections('','','',1,'Filter1'))

+ len(GetCurrentSelections('','','',1,'Filter2'))

+ len(GetCurrentSelections('','','',1,'Filter3'))

+ len(GetCurrentSelections('','','',1,'Filter4'))

+ len(GetCurrentSelections('','','',1,'Filter5'))

     =0, '$',

if(len(GetCurrentSelections('','','',1,'Filter1'))>0, 'Filter1+','')

& if(len(GetCurrentSelections('','','',1,'Filter2'))>0, 'Filter2+','')

& if(len(GetCurrentSelections('','','',1,'Filter3'))>0, 'Filter3+','')

& if(len(GetCurrentSelections('','','',1,'Filter4'))>0, 'Filter4+','')

& if(len(GetCurrentSelections('','','',1,'Filter5'))>0, 'Filter5+','')

& '0')

this worked for me ..

Thanks

bvssudhakar
Creator III
Creator III

Hi Rob ,

Excellent!!

This is what i was looking for and this serves my exact requirement .

but with just one small change. instead of the & filters in the variable i want to pass the data which will satisfy all the 5 filters applied.

which means the data which matches all the filters in 5 sets should only display in the result chart / table.

Should i change in the vFilterStates variable expression or should i modify the expression in the chart.

Kindly suggest on how to achieve this.

Thanks

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

If the data should match all the filters, isn't that the same as normal Qlik selection logic?

-Rob

bvssudhakar
Creator III
Creator III

No, it is not showing matching values. all selections related rows are appending one by one

Here, i am giving one example for my requirement from your file only:

If i select for filter 1: Baby Clothes in Category Name, Aino Shoes from Product name, 2012 from Year and

for filter2:Baby Clothes in Category Name, Deuce Shirt from Product name, 2013 from Year

then i want out like this

      

24222/16/2012Baby ClothesAino ShoesHalle KölnBob Park41
24222/16/2012Baby ClothesDeuce ShirtHalle KölnBob Park11
46651/21/2013Baby ClothesAino ShoesLa Moda d'il FuturiRicardo Gucci61
46651/21/2013Baby ClothesDeuce ShirtLa Moda d'il FuturiRicardo Gucci12

But output is not showing like this, it is showing selections related 572 rows some thing

Here i attached your file also.. in that file i made some changes so, based on that give some suggestions

Thank you in advance

Sudhakar