Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I'm trying to find max, min values for netted amounts throughout the day.
For every hour I'm calculating the net value for incoming and outgoing payments, leaving a negative or positive value.
Now I wish to rank these netted flows, for instance the largest positive and negative hourly flow for the selected date.
I tried the below, the syntax seems to be OK, but I'm only getting null values in return.
any ideas?
MAX (AGGR (SUM ( {<Receiver = {'US'}>} [Amount] )- sum( {<Receiver -= {'US'}>} [Amount] ), Time ) )
Thanks in advance,
Olle
Hi
Are you using this in a chart/table with the date as a dimension? If so, you need to include this dimension in your Aggr() function. Like this (assuming the date is a field called [Date]):
Max(Aggr(Sum({<Receiver = {'US'}>} [Amount]) - Sum({<Receiver -= {'US'}>} [Amount]), [Time], [Date]))
HTH
Jonathan
Hi,
Try something like this,
MAX (AGGR (SUM ({<Receiver = {'US'}>} [Amount]),Time)) - Max(AGGR (sum( {<Receiver -= {'US'}>} [Amount]),Time))
Regards,
Max(Aggr(Max({<Receiver = {US'}>}Amount)-Max({<Receiver -= {US'}>}Amount),Time))
Hi Max,
tried it and it's giving me the very same results as the below "core" calculation.
sum( {<Receiver = {'US'}>} [Amount] )- sum( {<Receiver -= {'US'}>} [Amount] ))
@MAnish,
receiving null values with your code.
//O
Hi,
Can you post sample application.
Regards,
Pls see attached Sample File, I've replaced counterpart names to "THEM" so no need for the -=US.
//O
Hi
Are you using this in a chart/table with the date as a dimension? If so, you need to include this dimension in your Aggr() function. Like this (assuming the date is a field called [Date]):
Max(Aggr(Sum({<Receiver = {'US'}>} [Amount]) - Sum({<Receiver -= {'US'}>} [Amount]), [Time], [Date]))
HTH
Jonathan
Thanks Jonathan!