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

AGGR problem

Hi All,

I have the table like this,

 

DateNameValue
1-Jul-17A10
1-Jul-17B20
1-Jul-17C30
1-Jul-17D12
1-Jul-17E45
2-Jul-17B5
2-Jul-17D12
2-Jul-17E15
2-Jul-17F10

Now i want the result in text box is sum of

(value of today - value of yesterday)/(value of yesterday) for

what are the name available in today.

Result calculation:

when you are select the date 2-Jul-17, the text box should show:  -1.41667

 

Name2-Jul-171-Jul-17 =(tdy-yestdy)/yestdy
2-Jul-17B520-0.75
2-Jul-17D12120
2-Jul-17E1545-0.66667
2-Jul-17F1000
This value comes in text box-1.41667

Please help.

1 Solution

Accepted Solutions
sunny_talwar

Try this

=Sum({<Date = {"$(=Date(Max(Date)))", "$(=Date(Max(Date)-1))"}>}Aggr(

(Sum({<Date = {"$(=Date(Max(Date)))"}>} Value)-Sum({<Date = {"$(=Date(Max(Date)-1))"}, Name = {"=Sum({<Date = {""$(=Date(Max(Date)))""}>} Value) > 0"}>} Value))/Sum({<Date = {"$(=Date(Max(Date)-1))"}, Name = {"=Sum({<Date = {""$(=Date(Max(Date)))""}>} Value) > 0"}>} Value)

, Name))

View solution in original post

4 Replies
jmvilaplanap
Specialist
Specialist

Hi,

Try with this expression:

(sum({<date={$(today())}>}value) - sum({<date={$(today()-1)}>}value))/sum({<date={$(today()-1)}>}value)

sunny_talwar

Try this

=Sum({<Date = {"$(=Date(Max(Date)))", "$(=Date(Max(Date)-1))"}>}Aggr(

(Sum({<Date = {"$(=Date(Max(Date)))"}>} Value)-Sum({<Date = {"$(=Date(Max(Date)-1))"}, Name = {"=Sum({<Date = {""$(=Date(Max(Date)))""}>} Value) > 0"}>} Value))/Sum({<Date = {"$(=Date(Max(Date)-1))"}, Name = {"=Sum({<Date = {""$(=Date(Max(Date)))""}>} Value) > 0"}>} Value)

, Name))

effinty2112
Master
Master

Hi Jeevay,

=sum(Aggr((sum(Value)-Sum({$<Date ={'$(=Text(Date(-1+max(Date))))'}>}Value))/Sum({$<Date ={'$(=Text(Date(-1+max(Date))))'}>}Value),Name))

returns

-1.4166666666667

Cheers

Andrew

jeevays7
Partner - Creator III
Partner - Creator III
Author

Thanks to all.