Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Formulas on calculated fields

Hi

I have the following expression

Days  OoS = count(if([Date Decarded]>0 AND [Resulting Stock]=0 and Branch='2002',([Product Code])))

I now need to take the result and multiply with retail price

I tried "sum( [Days OoS] * [Retail Price])" and  "sum( count(if([Date Decarded]>0 AND [Resulting Stock]=0 and Branch='2002',([Product Code]))) * [Retail Price])"

Does not work.

Any ideas?

Regards

Fanie

3 Replies
MK_QSL
MVP
MVP

please upload your sample file.

Anonymous
Not applicable
Author

Fanie,


The problem here is that you're trying to use one aggregation function (count) within another(sum):
sum(count(...))
It is not logical, hence not working.  To make it work, you have to aggregate the internal aggregation function by some dimensions:
sum(aggr(count(...),<Dim1, Dim2, ...>))

I can't tell you what fields you have to aggregate by.  Try to figure it out.  Or, upload sample file, as Manish says.

Regards,
Michael

Not applicable
Author

Hi Fanie

Without seeing the file its difficult to grasp this issue.  Can you share the qvw please?


Steve