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

Issue with pivot table Dimensionality() calculation

Hi Experts,

I need you help here.

I have a pivot table with two dimensions as shown here. "Sum" is an expression which is Sum(Count). All's good till here.

1.png

Now, my requirement is to substitute 0 to any item for which the sum =< 2. So I modified the expression as  expression

if(Sum(Count)>2,

Sum(Count),

0)

and those items affected by this change are shown by the yellow highlighted rows in below image

2.png

The problem here is, even though the expression resulting in value 2 (of corresponding to "item 2") is replaced by 0, the partial sum did not change and it still shows 19 instead of 17.

I am attaching the sample file I am working with. Any help would be much appreciated.

Regards,

Vishnu

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

You need an Aggr() to get the correct sum of rows value in a pivot. It will look like this:

Sum(Aggr(if(Sum(Count)>2, Sum(Count), 0), Category, Item))

HTH

Jonathan

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

View solution in original post

8 Replies
anbu1984
Master III
Master III

Try this expr

=Sum(If(Aggr(Sum(Count),Category,Item) >2,Count))

Anonymous
Not applicable

Use this instead :

if(Dimensionality()=1,sum(if(Count>2,(Count),0)),if(Sum(Count)>2,Sum(Count),0))

ankitaag
Partner - Creator III
Partner - Creator III

Hi Vishnu,

Write the expression as :

=sum(if(Count>2,Count,0))

Find your attached application with correction

Thanks and Regards,

Ankita

jonathandienst
Partner - Champion III
Partner - Champion III

You need an Aggr() to get the correct sum of rows value in a pivot. It will look like this:

Sum(Aggr(if(Sum(Count)>2, Sum(Count), 0), Category, Item))

HTH

Jonathan

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

tested,it's working

=Sum(If(Aggr(Sum(Count),Category,Item)>2,Count))

Not applicable

Hi Vishnu,

Please try this expr,

sum(if(Count>2,

Count,

0))

Saritha Xavier

Not applicable

hi.

if() helped! try using this in you expression

sum(

     if(count > 2,

          count,

          !0)

     )

vishnus85
Partner - Creator
Partner - Creator
Author

Thanks all.

Actually all of the answers worked. But for my actual scenario, I found

Sum(Aggr(if(Sum(Count)>2, Sum(Count), 0), Category, Item)) as the best fit.