Skip to main content

Hi

 

I have data that has invoice details with sales by customer and a single budget figure per customer.

 

I can show the total sales for each customer, and their budget using min(budget) and total using Sum.

 

The problem is that when I create a calculated field sales/budget, the value is correct for each line, but the Total is wrong whatever option I select in Total Using for the Budget field.

 

Any help getting the correct value for the percentage column would be greatly appreciated.

 

Thanks

 

Roy

9 answers
  1. Apr 9, 2015, 2:13 PM

    I found a solution that works in Version 9, if you are interested the details are attached

     

    if max([Type]) = Min([Type]) then

    sum([Sales])/min([Budget])

    ELSE

    window_sum(sum([Sales]))/sum({fixed [Type] : min([Budget])})

    END

    if max([Type]) = Min([Type]) then

     

    sum([Sales])/min([Budget])

     

    ELSE

     

    window_sum(sum([Sales]))/sum({fixed [Type] : min([Budget])})

     

    END
0/9000