4 Replies Latest reply: Jan 13, 2012 9:06 PM by jeje2011 RSS

    How to show graph conditionally

      Hi:

      In a list box i have 5 values , on selecting a particular value i want to show a specific graph.

       

      so if in list box A is selected then graph 1 should be shown

      if in the list box B is selected then graph 2 should be shown.

       

      Please let me know the solution to this.

        • Re: How to show graph conditionally
          Miguel Angel Baeyens de Arce

          Hi,

           

          Go to the chart properties, Layout tab, and set in the Show, Conditional dialog the following expression in each chart, changing the value in the right as required.

           

          GetFieldSelections(FieldNameHere) = 'A'
          

           

          GetFieldSelections() will return the value or values selected in a field. That will return true if the value (and only that value) is selected in the listbox or any other object, and show the chart. When any other value is selected, the chart will be hidden.

           

          Hope that helps.

           

          Miguel

            • How to show graph conditionally

              Miguel:

              Thanks.

              This code worked.

               

              But now i am facing one more problem,

               

              since it is a list box , when i select A , it shows up the graph but filters the whole dashboard with 'A' .

              I think this is happening due to association.

               

              I was hoping to just change these graphs based on the selections in the list box but rest of my boxes should remain

              unchanged.

               

              Is there a way to do this or should i use something else instead of list box.

                • Re: How to show graph conditionally
                  Miguel Angel Baeyens de Arce

                  Hi,

                   

                  Glad to be helpful.

                   

                  There are several approaches to that. Probably the most simple is going to the script and load only that field with a different name (in the listbox you can always change the label that is displayed in the dashboard). Then use this second field in the GetFieldSelections() instead of the previous. Since the name of this second field is different, and not related, it will not affect to your charts other than the how / hide property.

                   

                  You can get that using variables instead of fields, but only in the case that one and only one chart is visible at a time.

                   

                  Both of them are in the application attached.

                   

                  There is a third approach that uses set analysis in the expressions. But since there are a lot of charts, and more information in the dashboard, I'd rather use one of the previous.

                   

                  Hope that helps.

                   

                  Miguel