1 Reply Latest reply on Oct 30, 2012 3:01 PM by Tracy Rodgers

    Calculated Field Syntax Help

    Matthew Davis

      I am in the process of converting from using an SSAS cube to the SQL database.  I have a viz that is using two calculated members and a calculated field and I need help recreating this.  I will explain the process used to create this viz against the SSAS cube below.  I am new to using tableau against a SQL Database and there is many more options.  I am open to any options.


      I am displaying the expense amount (line) on top of the total payments (Bar) for a specific vendor.  The expense amount is being filtered to two specific cost centers.  The payments table does not have any cost center information which is why a filter will not work and the reason I need a single measure that includes the two cost centers.


      dual axis graph



      Here is how the line is being created.

      Calculated members

      Name: AH00077

      ([Measures].[Expenses Amount Wwops],[Cost Center].[ParentID].[AH00077])

      Name: AH00235

      ([Measures].[Expenses Amount Wwops],[Cost Center].[ParentID].[AH00235])


      Calculated Field

      Name: expense amount (line)





      Thank You for any assistance.

        • 1. Re: Calculated Field Syntax Help
          Tracy Rodgers

          Hi Matthew,


          From what I gather, two separate measures for each of the call centers wants to be created, then a third calculated field needs to be created to add the two together.


          By creating two fields similar to the following:


          if [Cost Center]="AH00077" then [Expenses Amount Wwops] end



          if [Cost Center]="AH00235" then [Expenses Amount Wwops] end


          Then, create a third calculation similar to this:


          sum([Calculation1]) + sum([Calculation2])


          Hope this helps!