3 Replies Latest reply on Sep 19, 2013 10:13 AM by Rossella Blatt Vital

    How to check if a field contains a specific element?

    Rossella Blatt Vital

      Hi,

       

      I need to create a calculated field that checks whether a certain element selected from the user exists in another field. For example, the user selects a client from a list of clients (Field CLIENT A) and this client is passed to another dashboard that uses a different list of clients (Field CLIENT B). If the client selected exists in the list CLIENT B, then the visualization in the second dashboard will be updated correctly. If it doesn't exist, then the visualization will be empty, in which case I would like to display a text warning the user that the selected client doesn't exist in the list Client B.

      So I would like something like:

       

      IF SelectedClient IS_NOT_MEMBER of [CLIENT B]

      THEN "my text"

      END

       

      Any idea of how I may achieve this?

       

      Thanks

      Rossella

        • 1. Re: How to check if a field contains a specific element?
          Tracy Rodgers

          Hi Rossella,

           

          One way you could do this is to create a string parameter that lists all of the Clients of CLIENT A. Then, create a calculated field similar to the following:

           

          if [CLIENT A PARAMETER]=[CLIENT B] then [CLIENT B] else 'my text' end

           

          Hope this helps!

           

          -Tracy

          1 of 1 people found this helpful
          • 2. Re: How to check if a field contains a specific element?
            Rossella Blatt Vital

            Hi Tracy,

             

            thanks for your help.

            If I understood correctly your idea, it will work only if the selection is done from the parameter (displayed as the list of clients). In my case though, the selection is done by selecting directly the client from the chart (a bubble chart with one bubble per client). Should I link this selection to the parameter? If so, I am not sure I understood how to do this.

             

            Thanks

            Rossella

            • 3. Re: How to check if a field contains a specific element?
              Rossella Blatt Vital

              To be more specific this is exactly what I am trying to do:

               

              1) I have 2 fields: CLIENTS_T1 (client for previous day) and CLIENTS_YEAR (clients for the whole year except the last week). So a client in CLIENTS_T1 doesn't necessarily appear in CLIENTS_YEAR and viceversa (for example a client that traded only yesterday will not appear in CLIENTS_YEAR and a client that traded throughout the year but not yesterday will not appear in CLIENTS_T1).

               

              2) I have also a parameter "YEAR OR T1" that the user can use to see data for T-1 only or the whole year. To do that I have created a calculated field "YEAR OR T1 CLIENTS" that uses the parameter "YEAR OR T1" to display CLIENTS_T1 or CLIENTS_YEAR.

               

              3) DASHBOARD 1 has a bubble chart with each bubble representing a client. There is also the parameter "YEAR OR T1". Let's say that the user selects "YEAR" from the parameter and then clicks on a client (on a bubble). The action filter will make the user jump to dashboard 2.

               

              4) DASHBOARD 2 has a treemap with the trades of that client by exchange. The dashboard has also the parameter "YEAR OR T1". When the user selects T1 from the parameter the treemap changes from displaying the number of trades for that client for the whole year, to the number of trades for that client for ONLY T-1 (the previous day). If the client did traded on T-1, then there is no problem. But if the client didn't trade on T-1, then the treemap will be empty. IN that case I would like to display the alternative text, explaining the user that the selected client didn't have any trading activity on T-1.

               

              I hope this helps clarifying what I am trying to do.

              Many thanks for any help

              Rossella