8 Replies Latest reply: Apr 21, 2010 1:15 PM by Ludwig123 RSS

    Dollar Sign Expansion

      Hi guys,

      In the load script I have :

      Let Content = 'Costs'

      How do I display this variable's value 'Costs' in a text object or expression.

      I tried variation of the following = ${ (Content) } but nothing returns 'Costs'

      Anyone know what I am doing wrong here?

      Thx

      Ludwig

       

        • Dollar Sign Expansion

          Hello ludwig, in this case you would not need the dollar sign eexpansion, you can only put

          =Content

          in your text object expression

          • Dollar Sign Expansion

            Sorry, I forgot to mention that if you want to use the dollar sign expansion (in case you have a column named Content), you can do it this way.

            ='$(Content)'

            Regards

              • Dollar Sign Expansion

                Thanks for the hint...the singe quotes did it....,ahaha!

                So to get a chart displaying values I thouth this would work..

                =Sum( ' $(Content)' ) but it didn't . What's wrong there?

                The variable Content is set to Revenue in the load script and I have a column revenue in the data.

                I'd like to add a button to change the variable per user klick to change the measure shown in the chart.

                What are the generall rules for these dollar sign expansision?

                Thx so much

                Ludwig

                 

                 

                 

                  • Dollar Sign Expansion

                    Hello, if you want your variable to expand the name of a column, you can simply take out the single quotes, like this:

                    sum($(Content))

                    so if the variable was declared to contained the value 'Revenue' and Revenue is the name of a data column, the expression should work just fine.

                     

                    Regards

                      • Dollar Sign Expansion

                        Great. It works.

                        Just a question how you go in debugging this types of issues...is there something more than try and error?

                        Error message are also not avialable...

                        Thx

                         

                          • Dollar Sign Expansion

                            Well it is a bit complicated that I could not explain very clear, it depends on how you declare the variable (let, set, nothing) and the use of the variable. I guess you can get the right result only with experience.

                            Regards

                              • Dollar Sign Expansion
                                John Witherspoon

                                It's like any programming language. If you understand the language, the syntax, how to assemble logical and data structures, you won't get stuck doing trial and error. You just know how to do it correctly. On the other hand, while LEARNING the language, you're probably going to go through a LOT of trial and error. If you don't want to learn by trial and error, you can also learn by doing things like carefully reading the reference manual or help text on whatever subject you're dealing with at the time. I learn by a combination of approaches myself, and both trial and error and reading are in there.