17 Replies Latest reply: Mar 13, 2014 1:26 PM by Jeremiah Kurpat RSS

    Filter data for only selected charts

    Manideep Hv

      Dear community,

       

      I have a requirement in filtering data.

       

      I have 2 line charts in a sheet. I need to filter those 2 charts with the help of slider. But those filtered slider values should not effect any of the other charts. and also If I want to filter data from any of the other filters it should effect the current chart.

       

      can we do this with the help of alternate states?

       

      Please help me in this

       

      Thanks a ton in advance.

       

      Regards

      Manideep

        • Re: Filter data for only selected charts
          Jared Papador

          Go into document properties (CNTL ALT D) and create an alternate state.  In the properties of the the slider (and the objects you want affected by the slider) set there state to the newly created state (this is on the general tab). "

           

          Also what do you mean by "also If I want to filter data from any of the other filters it should effect the current chart."

            • Re: Filter data for only selected charts
              Manideep Hv

              when I move the slider other filters and charts should not be affected. Only that particular chart that I want should be filtered. Again when I select an option from other filters that particular chart should need to affected

                • Re: Filter data for only selected charts
                  Jared Papador

                  So the step above is step one.  On the charts that will be affected by the slider... In your expression you will need to use set analysis.  It would look something like this.

                   

                  Sum({<Field1=$::Field1, Field2=$::Field2>} Value)

                   

                  You would put the names of the fields youd want to affect the chart where it says field 1, 2.. etc.

                    • Re: Filter data for only selected charts
                      Manideep Hv

                      with the above expression I can filter with slider only. But If I need to filter with other parameters i cant able to do that.

                        • Re: Filter data for only selected charts
                          Jared Papador

                          Try adding the name of the state to your set analysis expression like this:

                           

                          Sum({[NAME OF STATE HERE]<Field1=$::Field1, Field2=$::Field2>} Value)

                           

                          make sure to put it in brackets

                            • Re: Filter data for only selected charts
                              Manideep Hv

                              Tried that but no use

                                • Re: Filter data for only selected charts
                                  Jeremiah Kurpat

                                  Can you give us some idea what parameters you are trying to filter by? Can you give us a small example or post your app? If they are fields, then this should work:

                                   

                                  sum({<Date=$::Date, Product=$::Product>}Value)


                                  You can also set whole chart to the state you want on the general tab, near the chart title.

                                  • Re: Re: Filter data for only selected charts
                                    Manideep Hv

                                    here is my sample app. please help me on this.

                                      • Re: Filter data for only selected charts
                                        Jeremiah Kurpat

                                        What is your main goal for this requirement? The problem here is that when you make selections in your fields to your left, it will limit what LOT's you can choose in your LOT field. Therefore when you use filters on the left, you cannot carry them over over to the alternate state, unless you also restrict the alternate state to those LOTs.

                                          • Re: Filter data for only selected charts
                                            Manideep Hv

                                            Hi jerem1234

                                             

                                            I my attached application. I just want to apply my slider vlaues to only chart, not more than that. and if I again filter values from left side filters those needed to be applied in the chart as well. I need combination of both these.

                                             

                                            So My goal is apply slider values to single chart + apply all other filters to the same chart.(slider values should not effect other filter values)

                                             

                                            Please help me how to do.

                                              • Re: Filter data for only selected charts
                                                Manideep Hv

                                                any help please??

                                                  • Re: Re: Filter data for only selected charts
                                                    Jeremiah Kurpat

                                                    See if attached gets you want you want. I made your slider to the expression:

                                                     

                                                    =aggr(only({<LOT=P({$}LOT)>}LOT),LOT)

                                                     

                                                    So it only lists the Lots that are available for the selections made on the left.

                                                     

                                                    Then I added the set expression:

                                                    {$*IRFilters}

                                                    to your formulas.

                                                     

                                                    And changed your charts to that alternate state.

                                                     

                                                    The only thing here is that when you make a selection on the slider, then change your selections on the left, the Lot selections in the alternate state won't be cleared (so if the LOT numbers arent available in the current selections, they won't appear as selected in the slider).

                                                     

                                                    Hope this helps!

                                                      • Re: Filter data for only selected charts
                                                        Manideep Hv

                                                        Hi jerem1234

                                                         

                                                        we are very closer, This is what I need actually, But When I clear the selections the slider is completely disappearing. instead of that it would be good if we make a fixed length even if we clear the filters. Please help me in achieving this.

                                                          • Re: Filter data for only selected charts
                                                            Jeremiah Kurpat

                                                            What do you mean the slider is completely disappearing? The actually slider or the values that are displayed on the slider? You always might run into problems this way since the behavior you want is sort of the opposite behavior of how Qlikview wants to behave and that the sets of Lot numbers are not always the same for each selection.

                                                             

                                                            I think at this point, you may want to consider changing the way you go about it. Maybe re-visit your orignal question as to why you want the selections in Lot to not affect your other charts? Is there a simpler way? Maybe the user should be aware to clear the Lot selections since this may affect other charts.

                                                             

                                                            One option: Since you want to segregate these 2 charts from the others, I would put them on their own sheet. This way you can keep a slider (I would maybe use list box instead since this will restrict the possible values for Lot) for Lot without any alternate states. Then you can set a Trigger upon leaving this sheet, to clear all selections made in the Lot field. This way, you can customize the entire sheet with how you want these two charts to behave. Maybe change the design of the sheet, move things around, etc. Keeping it simple will make things easier, on both a User and Maintenance perspective. Hopefully some of these options sparks an idea for you.

                                                             

                                                            Hope this helps!

                                                              • Re: Filter data for only selected charts
                                                                Manideep Hv

                                                                Hi jerem1234

                                                                 

                                                                I want them in a sheet where other charts also exist in a contianer. Thats my actual requirement. I understood what you said. But here my problem is when I put slider is discrete mode, the length of the slider becomes zero until we palce a mouse pointer over there(thats what i mean in disappearing.). and If we put my Slider in continuous/Numeric mode it is showing only Lots with Numeric values. I have lots with both Numeric and string values. Please suggest.

                                                                  • Re: Filter data for only selected charts
                                                                    Jeremiah Kurpat

                                                                    So you want a default LOT selection every time I suppose?

                                                                     

                                                                    Create a trigger for OnAnySelect for your Document Event Triggers when you go to Document Properties on the trigger tab. Then add the trigger Select in Field with:

                                                                     

                                                                    Field = LOT

                                                                     

                                                                    Search String = =if(GetSelectedCount(LOT)<2, maxstring(aggr(only({<LOT=P({$}LOT)>}LOT),LOT)), '(' & concat(distinct aggr(only({<LOT=P({$}LOT)>}LOT),LOT), '|') & ')')

                                                                     

                                                                    This formula should work even with multiple LOT's selected. And I can't say how this will affect performance.

                                                                     

                                                                    Hope this helps!

                                        • Re: Filter data for only selected charts
                                          Jeremiah Kurpat

                                          Yes alternate states should be able to accomplish this, then for the charts to follow other filters (the default state) you'll need set analysis in your expression like:

                                           

                                          sum({<Date=$::Date, Product=$::Product>}Value)

                                           

                                          Hope this helps!