Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
Please is there any reason why the following will not work? It works if I calculate the sales average (sum/count) of each product separately; however, it does not work if I try to aggregate the sales average of both products. Am I missing an aggregate function?
=Num(sum({<Sale_Date={">=$(=Max(Sale_Date)-30)<=$(=Max(Sale_Date))"},ProductType={'Product 1'}>} Sales)/
Count({<Sale_Date={">=$(=Max(Sale_Date)-30)<=$(=Max(Sale_Date))"},ProductType={'Product 1'}>} Sales
+
sum({<Sale_Date={">=$(=Max(Sale_Date)-30)<=$(=Max(Sale_Date))"},ProductType={'Product 2'}>} Sales)/
Count({<Sale_Date={">=$(=Max(Sale_Date)-30)<=$(=Max(Sale_Date))"},ProductType={'Product 2'}>} Sales),'##%')
Regards
May be like below
Num(sum({<Sale_Date={">=$(=Max(Sale_Date)-30)<=$(=Max(Sale_Date))"},ProductType={'Product 1','Product 2'}>} Sales)/
Count({<Sale_Date={">=$(=Max(Sale_Date)-30)<=$(=Max(Sale_Date))"},ProductType={'Product 1','Product 2'}>} Sales),'##%')
Hi!
What dimension are you use?
Post some example qvw, please.
Hi,
The dimension is Sales
Unfortunately, I can not post the qvw.
try this:
=Num(
((sum({<Sale_Date={'>=$(=Max(Sale_Date)-30)<=$(=Max(Sale_Date))'}, ProductType={'Product 1'}>} Sales)
/
Count({<Sale_Date={'>=$(=Max(Sale_Date)-30)<=$(=Max(Sale_Date))'},ProductType={'Product 1'}>} Sales))
+
(sum({<Sale_Date={'>=$(=Max(Sale_Date)-30)<=$(=Max(Sale_Date))'},ProductType={'Product 2'}>} Sales)
/
Count({<Sale_Date={'>=$(=Max(Sale_Date)-30)<=$(=Max(Sale_Date))'},ProductType={'Product 2'}>} Sales)))
,'#.##')&'%'
also make sure Format of your expression and SalesDate should be same...
May be like below
Num(sum({<Sale_Date={">=$(=Max(Sale_Date)-30)<=$(=Max(Sale_Date))"},ProductType={'Product 1','Product 2'}>} Sales)/
Count({<Sale_Date={">=$(=Max(Sale_Date)-30)<=$(=Max(Sale_Date))"},ProductType={'Product 1','Product 2'}>} Sales),'##%')
So, do you want to get a straingt table with Sales as dimension ans sum Sales as expresion?
Sales is your dimension???
Which chart you are using?
This works perfectly well.
Thanks a lot
Regards to all.
I am glad that it is helpful.