15 Replies Latest reply: Oct 22, 2017 6:18 PM by Sunny Talwar

Totals function - Auto and Sum

When i use 'Auto' in total fuctions the total value i get is 5.35% but when i choose 'Sum' in Total functions i get 3.24%.

The individual values are same for both Value 0 and Value 1 as formula i am using here is

(\$(='(1+Sum({<B=Comp,DateField={"' & GetFieldSelections(DateField,'"}>} Sales*0.01)) * (1+Sum({<B=Comp, DateField={"') & '"}>} Sales*0.01))')-1)/100

My question :

i want to get total value using expression, so i put total just before sales in the formula

(\$(='(1+Sum({<B=Comp,DateField={"' & GetFieldSelections(DateField,'"}>} total Sales*0.01)) * (1+Sum({<B=Comp, DateField={"') & '"}>} total Sales*0.01))')-1)/100

and it gives me 5.35

How do i get 3.24 instead of 5.35 using expression ?

• Re: Totals function - Auto and Sum

This will shed some light perhaps.

regards

• Re: Totals function - Auto and Sum

thanks for replying pradosh ,but that tells me the difference between auto and sum

my question is how do i achieve that sum total using expression because i need to use that total at some other place

• Re: Totals function - Auto and Sum

expression:

sum((\$(='(1+Sum({<B=Comp,DateField={"' & GetFieldSelections(DateField,'"}>} total Sales*0.01)) * (1+Sum({<B=Comp, DateField={"') & '"}>} total Sales*0.01))')-1)/100)

• Re: Totals function - Auto and Sum

Sorry,already tried this but it doesn't work because that formula you enclosed within sum gives a single value 5.35

• Re: Totals function - Auto and Sum

you tried sunny's expression? That shall work.

regards

• Re: Totals function - Auto and Sum

with that i get  0.00%

• Re: Totals function - Auto and Sum

Did you specify your dimensions in there?

• Re: Totals function - Auto and Sum

I tried GetFieldSelections(Dimension) there but doesnt work

• Re: Totals function - Auto and Sum

GetFieldSelections(Dimension)? What is this? What is the dimension that you use in your chart?

• Re: Totals function - Auto and Sum

May be this

Sum(Aggr(

(\$(='(1+Sum({<B=Comp,DateField={"' & GetFieldSelections(DateField,'"}>} Sales*0.01)) * (1+Sum({<B=Comp, DateField={"') & '"}>} Sales*0.01))')-1)/100

, YourDimensionsHere))

• Re: Totals function - Auto and Sum

Hi Sunny Talwar,

This formula works

Sum(Aggr(

(\$(='(1+Sum({<B=Comp,DateField={"' & GetFieldSelections(DateField,'"}>} Sales*0.01)) * (1+Sum({<B=Comp, DateField={"') & '"}>} Sales*0.01))')-1)/100

, YourDimensionsHere))

but i am only able to add one dimension here. But if i use that pick formula here for dynamically choosing dimension it becomes 0.

• Re: Totals function - Auto and Sum

There are too much back and forth between two threads of yours and I am confused what is your dimension? Have you tried this?

=Exp(Sum(Aggr(Log(1+Sum({<TimeKey = {"\$(='>=' & Date(Min(Date#(Start_Date, 'YYYYMMDD'))) & '<=' & Date(Max(Date#(End_Date, 'YYYYMMDD'))))"}>}Sales)), TimeKey,

\$(=If(GetSelectedCount(Select_1st_Dim) = 1,

Pick(Match(GetFieldSelections(Select_1st_Dim),'ABC', 'DEF'), 'ABC', 'DEF'),

'ABC')) ))) - 1

• Re: Totals function - Auto and Sum

Besides did you try the alternative approach to calculating what you intended?

=Exp(Sum(Aggr(Log(1+Sum(Sales)), TimeKey))) - 1

• Re: Totals function - Auto and Sum

Thanks Sunny but it doesnt work, i tried this already

• Re: Totals function - Auto and Sum

I attached a sample, did you check that? Attaching again with an image