Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ferha_jafri
Partner - Creator III
Partner - Creator III

Need help in writing the expression for total in pivot table

Hello everyone,

I need help in writing the expression for total in pivot table.In my case i have two dimension one is state and one is product and they want to view the total for both the dimensions.Now the issue is that they want product dimension at the top of the table so when i am writing an expression for the total it is different for both the dimension so i want to know how i can do this.

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

You can write an expression that evaluates differently for the total rows by using Dimensionality()

If(Dimensionality() = 0, ... expression for grand total of all states/products ... ,

    If(Dimensionality() = 1,  ... expression for total for all products in each state  ... ,

        If(Dimensionality() = 2, ... expression for total per product ... ,

          ... expression for detail lines

        )

    )

)

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

1 Reply
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

You can write an expression that evaluates differently for the total rows by using Dimensionality()

If(Dimensionality() = 0, ... expression for grand total of all states/products ... ,

    If(Dimensionality() = 1,  ... expression for total for all products in each state  ... ,

        If(Dimensionality() = 2, ... expression for total per product ... ,

          ... expression for detail lines

        )

    )

)

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein