Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
I have a chart with a 'aggr' function to calculate a share of a product in a certain category ;
(selection Month=12)
For 'Share in Category' I use the function;
Sum (Value) / aggr(NODISTINCT sum(Value),Category)
Now I want a chart with on the dimension the months, this looks like this
So far all works fine! See the value for month 12 in this table en the value in the first table! Now I want to add the share;
As you see i do not get the right value for share, the problem is the second part of the function;
aggr(NODISTINCT sum(Value),Category)
This one doesn't work right in the the last table, but when I select only one month in the table, it works fine again??!!;
Can anyone help me out here?? Thanks in advance!!
I attached an example!
Found the solution!;
aggr(NODISTINCT sum({<Product=>}If(InYearToDate(Date#(DateKey,'DD-MM-YYYY'),Date#('01'&'-'&CHART_Month&'-'&$(=PIT_Year),'DD-MM-YYYY'),0), Amount)),Category, CHART_Month)
The problem is that the aggr functions doesn't look to the dimension
Good Day, Try to use Group By at the script
Can you give me an example please?
Found the solution!;
aggr(NODISTINCT sum({<Product=>}If(InYearToDate(Date#(DateKey,'DD-MM-YYYY'),Date#('01'&'-'&CHART_Month&'-'&$(=PIT_Year),'DD-MM-YYYY'),0), Amount)),Category, CHART_Month)
The problem is that the aggr functions doesn't look to the dimension