1 Reply Latest reply on May 13, 2017 10:37 AM by TomHays

    Filter records depending on results in a calculation field with a CASE function

    manuelruizga

      I have set a calculation field with a CASE function which, based on its calculation, gives 40 diferent results. The purpose of this field is to give information about the status in a judicial procedure depending on the data inserted in the record.

       

      I have also set a list layout where you can see all records. I would like to filter them depending on the diferent results in this calculation field. The problem is, I can't filter this field because it is showing text inserted previously in the calculation.

       

      To solve this I thought making 40 global fields and seting the calculation field to show as a result one of this 40 global fields (depending on its calculation). This global fields would have as text the diferent 40 results inserted before as text in the calculation field. Yet, I don't know how to filter all the records in the list layout depending on the diferent global fields this calculation field is showing.

       

      I don't know if this is a correct aproach. I am really lost on how to do this. Any help will be apreciated.

       

      Thank you all in advance!

        • 1. Re: Filter records depending on results in a calculation field with a CASE function
          TomHays

          If I understand correctly you have a field called cResultsCalc (for example).

           

          You want to be able to view a Found Set of records in a list layout that are chosen based on the value of cResultsCalc.

           

          The general practice is to perform a Find on the cResultsCalc field to get the records that match your criteria.

           

          How you go about programming that into your layout buttons and scripting depends on the user interface you want to achieve.

           

          If you have constructed the calculation in cResultsCalc to be difficult to perform a search, I recommend making another field cResultsCalcFindKey that does a similar Case() calculation but with each resulting value being something easily searchable.

           

          If you have

          cResultsCalc = (

            this="that"; "This is the result of the first case that is for humans to read";

            this="the other thing"; "This is the second result of the other case that is for humans to read";

            this="yet something else"; "This is the third result of the new case that is for humans to read";

          ""

          )

           

          then you might want to make

          cResultsCalcFindKey = (

            this="that"; "Case001";

            this="the other thing"; "Case002";

            this="yet something else"; "Case003";

          ""

          )

           

          and then Find (or Filter) on the simpler values ("Case001", "Case002", etc).

           

          -Tom

          1 of 1 people found this helpful