Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I want to find outh the minimum value of the sum(Amount) excluding 0.
below is the example, Shows listbox with expression and Frequency of occurance of each value.
Here lowest value is 12 excluding 0. so i can find out thhis using Min(Sum(total<Product>Amount),3). here i've use second parameter as 3 because 1st two values are 0. but this is not the case all the time. each time i may not know how many entries of 0 will be there, how should i find out this minimum value. |
Pl find attached. Hope that helps you.
hi,
you need the aggr() function.
try this:
=min(if(aggr(sum(Amount),Product)>0,aggr(sum(Amount),Product)))
Try this:
Since Sum is a field:
min({$<Sum={'<>0'}>} Sum)
Thanks all for replies.
As suggested in Min value.qvw app , filtering is done at modelling level.
but i can not go with this approach because i need 0 value entries for some other purpose.
pat.agen, your suggestion really hepls me and i'm able to achieve what i wnated.
Since sum is not a field, it is calculated expression, i can not go with the 3rd suggestion.
Hi,
I tried in this way it is giving the correct result .Even i have not filtered any records at script level.
Min(aggr(IF(SUM( Total<Product>Sum)>=0,Sum(Total<Product> Sum)),Product))
Check this..
Regards,
Ajay
do
load
sum(Amount) as TotalAmount,
Product as Product,
Month as Month,
Year as Year
group by Product, Year, Month
resident yourtable;
and you´ll have it as a field.