3 Replies Latest reply: Jun 4, 2015 6:29 PM by Petter Skjolden RSS

    Button to select multiple fields with logical OR

    Susanne Lee

      Hello,

       

      I'm trying to find a way to have  a selection of 2 fields with a button.

      What I basically want is a button that shows

      Sold items that are marked as 'Sold' in the field 'Status'

      OR

      Sold items that are marked as 'Sold' in the field Inventory

       

      so basically a button with:

      Select in Field: Status OR Inventory

      Search String: *Sold*

       

      is that somehow possible?

        • Re: Button to select multiple fields with logical OR
          Antonio Mancini

          Hi,

          If You have

          Field,Status,Inventory

          A,        a,         Sold

          B,        Sold,      b

          ..........

          If You select A, You exclude B.

          However ,You can add to script

           

          Load *,

          If(Status='Sold' or Inventory='Sold',1) as Flag;

          Load  * from .......;        // or SQL Select * from ...;

          Then in Your Button -> Select -> Action -> Select in Field Flag -> 1.

           

          Also You can use expression like

          Sum({<Status={'Sold'}>+<Inventory={'Sold'}>} Value)

          in your objects.

          Regards,

          Antonio

          • Re: Button to select multiple fields with logical OR
            Stefan Wühl

            Basically you want to select Items, right?


            Try creating a button with action Select - Select in field


            Field:

            Item


            Search string:

            ='=Status like ' & chr(39) & '*Sold*' & chr(39) & ' or Inventory like ' & chr(39) & '*Sold*' & chr(39)

            • Re: Button to select multiple fields with logical OR
              Petter Skjolden

              Well the simplest and most straightforward approach I think might be to have a small two column table generated like this in your load script:

               

              AbsolutelySold:

              LOAD

                   Item,

                   (Status = 'Sold') AS DefinitelySold

              RESIDENT

                   TableWithTheField_Status;

               

              LOAD

                   Item,

                   (Inventory = 'Sold') AS DefinitelySold

              RESIDENT

                   TableWithTheField_Inventory;

               

               

              If the two fields are in the same table you can simplify it like this:

               

              AbsolutelySold:

              LOAD

                   Item,

                   (Status = 'Sold' Or Inventory = 'Sold') AS DefinitelySold

              RESIDENT

                   TableWithTheTwoFields_Status_and_Inventory;

               

               

               

              In you application you can have the field DefinitelySold in a list box and that will act as your button.