Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have two fields in a table and I have made selections in field one (text) values that have associated values in field 2. When I go, to sum up the values of the fields that I've selected using sum(field) and my total is incorrect.
Example
fields selected in a list box are B,C,D
Table 1
sum(Field2)
Field 1 Field 2
B 5
C 4
D 3
6 = Total
Are there any duplicates or your expr is using any DISTINCT in your Sum() function in the front end worth a check.
Looks like, while calculating the sum only distinct data values were considered.
in given example Numbers 8 & 9 have multiple occurrences. While summing if only distinct values are considered then sum value will come up as 35 instead of 52.
There may be, a variable used in your measures expression, was not able to compute successfully. When you filter by that dimension as dimension did not affect the variable.
Try to amend the variable to ignore all filters, then the expression will be, able to compute even with filter applied.
are you using distinct function for a dimension in set expression of sum? it could be possible that you might have some duplicates among dimensions. for total option, you can use SUM instead of auto
Sager,
Thank you for the input are you suggesting the sum of rows in the total mode, when you say "you can use SUM instead of auto"?
Thanks,
John Worth
BI Data Analyst
Upper Lakes Foods
p: 800.879.1265 ext 4278
w: upperlakesfoods.com<http://upperlakesfoods.com/>
Bala,
Can you show me an example?
Thanks,
John Worth
BI Data Analyst
Upper Lakes Foods
p: 800.879.1265 ext 4278
w: upperlakesfoods.com<http://upperlakesfoods.com/>
Rohan,
Thank you for the feedback, the formula in the example was sum(Field 5), but I do see where using sum (distinct Field 5) would give you a result closer to 39.
Thank you,
John Worth
BI Data Analyst
Upper Lakes Foods
p: 800.879.1265 ext 4278
w: upperlakesfoods.com<http://upperlakesfoods.com/>
sum(num(Field2))
William,
Thanks for the update,
John Worth
BI Data Analyst
Upper Lakes Foods
p: 800.879.1265 ext 4278
w: upperlakesfoods.com<http://upperlakesfoods.com/>
In your example the sum is less than the expected total.Is that actually happening or is the total to large? If you data model is incorrect I would expect the total to be duplicating values making to actual total larger.
If you change sum to count, do you have to correct number of records?