Forum Discussion

RubyKapil's avatar
RubyKapil
Qrew Trainee
6 years ago

Filter Across Similar Fields only shows Field 1 values

Need some formula help --
4 Multi-Choice fields in same table: Company 1, Company 2, Company 3, Company 4.
Each of these 4 fields has the same set of Choices: Red, Blue, Green, Yellow.
Each record can have 0-4 Company fields filled in.
I need a filter to identify if any of the 4 fields has "Yellow", then filter will show word "Yellow". Or if any of the 4 has "Red", show the word "Red".

a. I created concatenated field Company1234 and then created a Formula Text field
If (Contains([Company1234, "Yellow")=true, "Yellow", Contains([Company1234, "Red")=true, "Red", Contains([Company1234, "Blue")=true, "Blue", Contains([Company1234, "Green")=true, "Green","")
Doesn't work the way I need it to - seems to only filter to show if Company 1 is the value.

b. I tried another Formula Text field 
If((Contains([Company 1], "Yellow")=true or Contains([Company 2, "Yellow")=true or Contains([Company 3], "Yellow")=true or Contains([Company 4], "Yellow")=true), "Yellow",
(Contains([Company 1], "Red")=true or Contains([Company 2, "Red")=true or Contains([Company 3], "Red")=true or Contains([Company 4], "Red")=true), "Red",    etc
This also filters if Company 1 has the value.

This is part of an older app which was setup as a large flat file and I am trying to create some filters to check data while I transition it to Parent Child structure.

------------------------------
Ruby Kapil
------------------------------
  • Maybe this is what you want
    List(", ",
    If(Contains([Company1234], "Yellow"), "Yellow")
    If(Contains([Company1234], "Red"), "Red")
    If(Contains([Company1234], "Blue"), "Blue")
    If(Contains([Company1234], "Green"), "Green"))


    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    markshnier2@gmail.com
    ------------------------------
    • RubyKapil's avatar
      RubyKapil
      Qrew Trainee
      Thanks Mark. The result I want is a Single value to show in the filter result, Green if any of the 4 companies have Green, Red if any of the 4 companies have Red.
      Blue,
      Green
      Red
      Yellow

      The List formula above is similar to my Company1234 field in that the filter results are: 
      Green
      Green, Red
      Red
      Red, Yellow


      ------------------------------
      Ruby Kapil
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        I guess I do not understand what you want to have happen if some of the companies have red and other have yellow and others have green.

        ------------------------------
        Mark Shnier (YQC)
        Quick Base Solution Provider
        Your Quick Base Coach
        http://QuickBaseCoach.com
        markshnier2@gmail.com
        ------------------------------
  • Ruby,

    Since this is a temporary use you can do one long list:

    If (  [Company1], "Yellow")=true, "Yellow,
    [Company2], "Yellow")=true, "Yellow",
    [Company3], "Yellow")=true, "Yellow",
    [Company4], "Yellow")=true, "Yellow",
    [Company1], "Red")=true, "Red",
    [Company2], "Red")=true, "Red",
    [Company3], "Red")=true, "Red",
    [Company4], "Red")=true, "Red",  "Not Red or Yellow"  )


    ------------------------------
    Don Larson
    Paasporter
    Westlake OH
    ------------------------------
    • RubyKapil's avatar
      RubyKapil
      Qrew Trainee
      Thanks Don. It will filter to a single value, but the filter is only capturing those records where Company 1 is Yellow. If Company 2 is Yellow, it will not show up in the list of records for Filter = Yellow.

      ------------------------------
      Ruby Kapil
      ------------------------------
      • DonLarson's avatar
        DonLarson
        Qrew Elite
        Ruby,

        What is the behavior you want on record if this is the data:

        Company 1 Yellow
        Company 2 Red
        Company 3 Green
        Company 4 Green

        For this single record you have one yellow, one red and two greens.   What do you want the formula to output?

        ------------------------------
        Don Larson
        Paasporter
        Westlake OH
        ------------------------------