Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I encountered below 'bug' when trying to develop some reports for my client.
Straight Table & Pivot Table subtotal & total are wrong (circled in red). They are based upon 'expression' instead of 'sum of total' which cannot be controlled by us :
Please help. I also attach the qvw file for easy reference.
Thanks,
Eric
It's not a bug. You're using an expression that's not a pure sum that be totaled as-is at every level. The expressions is also evaluated at the total levels and the result there is not the same as the sum of the results at the detailed level because of your if statement. What you want is the sum of an aggregation expression: sum( aggr( ...your_expression...), Type, Date, Description)): sum(aggr( if(Profit<0,0,Profit*.3) ,Type,Date,Description))
It's not a bug. You're using an expression that's not a pure sum that be totaled as-is at every level. The expressions is also evaluated at the total levels and the result there is not the same as the sum of the results at the detailed level because of your if statement. What you want is the sum of an aggregation expression: sum( aggr( ...your_expression...), Type, Date, Description)): sum(aggr( if(Profit<0,0,Profit*.3) ,Type,Date,Description))
Hi,
Please find the attached file
Regards,
Mahesh
Thanks Wassenaar! It works now.
Regards,
Eric
Thanks Mahesh for your reply! By the way, I only have personal version so cannot open your file.
Hi,
This might be easy to understand..
use this expression to calculate your tax:
=sum(if(Profit>0,Profit* .3))
The problem with your expression is it is taking sum of all the items although you are replacing them with '0' .
-Kamal