2 Replies Latest reply: Jun 11, 2013 10:51 AM by Adam Haithcox RSS

    Expression after horizontally listed expression

    Adam Haithcox

      How can I add an expression after a horizontally listed expression without it falling under the horizontal values? In the case below, I want to list the sum of sales for each customer# after the last Product column value.

       

      Capture.PNG

       

      So I DONT get this result:

       

      Capture1.PNG

        • Re: Expression after horizontally listed expression
          Stefan Wühl

          You can use partial sums (AKA subtotals / totals, which you can enable in presentation tab per dimension) and use dimensionality() resp. secondarydimensionality() to switch your one expression to show your discount percentages in your detail columns and the sum in your total column.

           

          Something along these lines:

           

          =if(SecondaryDimensionality() = 0,

                    YourSumExpression,

                    YourPercentageExpression

          )

            • Re: Expression after horizontally listed expression
              Adam Haithcox

              Excellent answer swuehl! That worked perfectly. Any suggestions on how to format the two ( sales, percent ) seperately? I currently have my expression formated as "Fixed to" 1 decimal place and "Show in Percent%" which is fine for the percentages but not the sales.

               

              Here's my expression now:

               

              If(SecondaryDimensionality() = 0, If(Sum([Discount Percent]) > 0, Money(Sum([Sales Amount]))), [Discount Percent])

               

              Capture.PNG