4 Replies Latest reply: Nov 13, 2014 10:01 AM by Josh Campbell RSS

    Master Library & Measures

    Josh Campbell

      Does anyone know if it's possible to use or reference a measure in the Master Items / Library in another measure? For example, I have a measure in the library that calculates a total spend from various products. I'd like to create another measure that uses this but it would be easier / better to simply be able to add something like Sum([Products_Total]) with "Products_Total" being my library measure.


      Any suggestions would be greatly appreciated.


        • Re: Master Library & Measures
          Jonathan Poole

          You can't reference another measure from the formula of a different measure.


          But what you can do is save the expression as a variable in the load editor using the SET script command as follows




          Set vSales='sum(Sales)' ;


          And then be able to use the variable in the formula of a measure. Just make sure to use the dollar sign expansion syntax as follows to invoke the string of characters within the variable as a dynamic expression




          sum(Costs) /  $(vSales)

            • Re: Master Library & Measures
              Josh Campbell

              Thanks for the quick reply Jonathan. I'm having an issue with this. I got the measure stored in a variable called "vHotelCost". My expression or measure is "Sum([Book Rate (Hotel)]) * Sum(Nights) * Sum(Guests)". So I tried using the following measure in my bar chart to display the percent of spend in each hotel city:

              Sum([Book Rate (Hotel)]) * Sum(Nights) * Sum(Guests) /  $(vHotelCost)


              That did not work. So I tried the following:

              Sum([Book Rate (Hotel)]) * Sum(Nights) * Sum(Guests) / Sum(Total $(vHotelCost))


              That did not work either. Any suggestions?