I have a question on placing the aggregate function at different parts of the report.
As shown in the attachment, I am just selecting the dimension ‘COST’. That gives me 8 rows of data. When I insert sum on that column I get proper sum value. But if I give the same formula in a blank cell i.e Sum([COST]) then I am finding the discrepancy in the sum value.
I did go through the concepts of input/output contexts but it did not help me as I am not using any context. I am just selecting the coulmn COST.
I am missing a basic concept here. Can you please help me understand the concepts.
Is there a difference between creating a variable COST_VAR and declare this as Measure at report level and converting the Dimension COST to measure at universe level?
The SQL will be different. An object defined in the universe as a measure and with a SQL aggregate function like SUM in the SELECT will have a GROUP BY clause, thereby returning fewer rows (and better performance). Including a projection function will enable dynamic roll-up when, for example, a dimension is removed from the report. Here is a link to required reading on the subject.
I do not have any filters defined. I am just pulling the onject COST, doing a sum on it which gives me 25,064. But when I place the same formula =sum([COST]) it is giving me 100,257 as the value.
Attached is the snapshot of the report for yur reference.
this type of problem generally happens if you are using
filters at query level
Or
filters at report level.
Or
If you don’t have any time filters then it could be the other objects/measures used at query level along with the cost object are playing their part.