5 Replies Latest reply: Jul 12, 2012 7:40 AM by Jonathan Dienst RSS

    Filter in listbox

      Hi,

       

      I have the follwing problem: I need to build a filter to select all status (1 - 9)  or all status exept one (1 - 8).

      I want to make an listbox with to options (filter 1-9 and filter 1-8 as text). Is this possible?

        • Re: Filter in listbox
          j i

          You can load it in an island table and use it in the filter.

          • Re: Filter in listbox
            Jonathan Dienst

            Ruud

             

            If the status1 values 1-9 are static, you can add the following inline load, and then use a list box for StatusGroup.

             

            LOAD * Inline

            [

                 Status, StatusGroup

                 1, 1-8

                 1, 1-9

                 2,1-8

                 2,1-9

                 ...

                 8, 1-8

                 8, 1-9

                 9, 1-9

            ]

             

            If the status is more dynamic than that, then incorporate the load logic into you script when loading the statuses. If you need me to be more specific, then please post your model, or a representative part of the load script.

             

            Hope that helps

            Jonathan

              • Re: Filter in listbox

                Hi Jonathan,

                 

                I have this scriptpart (Call_status is to be filter ed). How do I integrate your inline load script ?

                 

                 

                load *,

                class(MeldingAfhandeling,10) as Class,

                left(Call_status,1) as Call_statusnr;

                  • Re: Filter in listbox
                    Wojciech Parzyszek

                    just load it as a different table:)

                    • Re: Filter in listbox
                      Jonathan Dienst

                      Ruud

                       

                      You have changed the field name from your original post. I assume that Status is Call_statusnr in your last post.

                      If the values are static (ie always 1-9) and the filter is static (1-8 vs 1-9), then just add the inline table into your script. The location is unimportant. Remember to change the field name Status on the inline to Call_statusnr!

                       

                      Or you could use something like this (after you loaded the statuses in the script fragment you posted)

                       

                      Set Limit = 8;

                       

                      StatusGroups:

                      LOAD Call_statusnr,

                           'All' As StatusGroup

                      Resident Data;

                       

                      LOAD Call_statusnr,

                           '1-$(Limit) Only' As StatusGroup

                      Resident Data

                      Where Call_statusnr <= $(Limit);

                       

                      Again, use a list box with StatusGroup. You can control the split in the list box by adjusting the value of Limit above.

                       

                      Regards

                      Jonathan