4 Replies Latest reply on Apr 9, 2018 7:48 AM by elizabeth.rathburn

    Dynamic Text

    elizabeth.rathburn

      Is there a way to make dynamic text based on if a number increases or decreases? So if the number increased from last month I want to say "Total sales increased by <monthly change> in <current month>." Or if it decreased I want it to say "decreased by". I can't attach a packaged workbook because it's confidential information. I have the monthly change and current month already figured out, I just don't know how to do the other part. Any help is appreciated!

      Thank you!

        • 1. Re: Dynamic Text
          Jacob Goffin

          Hi Elizabeth,

           

          The simplest option would be to change the wording to "Total sales changed by <monthly change> in <current month>." and have the positive/negative value of monthly change indicate if it is increasing/decreasing. But, if you want to be able add that dynamic wording you should be able to with a calculation. I've used Superstore to demonstrate example, writing a calculation "Dynamic Text"

          that has the structure:

           

          IF [Monthly Change] >= 0

          THEN "increased by"

          ELSE "decreased by"

          END

           

          The result is the snapshot below (and see attached workbook as well), where I've put the dynamic text in the tooltip.

           

          dynamic text.png

           

          Hope this helps.

           

          Cheers,

          Jacob

          1 of 1 people found this helpful
          • 2. Re: Dynamic Text
            Jim Dehner

            Hi Elizabeth

             

            I will assume you have made the appropriate calculation

             

            so yes you can create an IF then statement something like

             

               label =       If [monthly change] > 0 then " increased by ' else ' decreased by' end

             

             

            Then you other statement (could be in a tool tip)     =      'Total sales' + [label ] + 'by ' +str([monthly change]) + ' for the month ' + str([current month])

             

            You may need to play with the syntax depending on the calculations you used and the actual value of the change may need to be rounded

             

            Jim

             

            If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

            • 3. Re: Dynamic Text
              Ivan Young

              You will need  datevalue or datepart, str and IF functions and perhaps some LOD but it is possible.

              • 4. Re: Dynamic Text
                elizabeth.rathburn

                Thank you Jacob! This did work.

                Now, what if the number did not change? So [Monthly Change] = 0.

                 

                Thank you,

                Elizabeth