Please, has anyone already noticed that SAS Viya makes calculation errors? For example, it calculates the total of 1+6 as 8. Any solutions, please?
Hello @Naiii ,
I personally would like to ask you to provide some evidence, specially when you raise such question or statement.
It would help us understand.
For example, the "error" you indicate, could be well a rounding up/down typical issue on the generation/definition of your report, which you could find in other applications, any, really. To give you a quick example, when the data is behind what is shown is 1.65 (just stripping all decimals or the cell is not large enough) and 6, the cells might show 1 and 6 but rounding up the total is 8 (when round up in totals/aggregation).
Looking forward to hearing back from you.
Often what confuses people is that most visualizations display aggregated data, but calculations are evaluated at the row level. If you create a list table with "detail data" enabled, the values should look correct. Especially if you set the data format to display more decimal places.
Let us know if that helps to clear things up.
Sam
Open your favorite speadsheet software.
Assign numeric display of a column to show no decimals.
Enter 1.45 in the first row
Enter 6.45 in the second row
Sum the two on row three in the same column.
Because you set the display limit to exclude decimals the cells will show 1, 6 and 8. The 8 is because the display rounded the actual summed value of 7.9 up to 8. Also why I picked values with .45 as the decimal portion as each of those gets rounded down.
So not just a SAS Viya behavior. This has been around for a very long time actually predating computers: when to round in calculations.
Just to add what already has been said.
data demo;
a=10/3;
b=10/3;
c=10/3;
total=sum(a,b,c);
run;
proc print data=demo;
format _numeric_ f16.1;
run;
The numbers do not contain decimals
In that case, it sets total = 7.
Hi @Naiii ,
yours is a visual representation. Any tool that does visual reporting has sometimes the challenge of visual representation vs data, in terms of decimals and aggregations.
I can observe you presented us with your visual representation in 2 separate screenshots, which tells me there i still more to this story. Either in the formulas or your data behind the scenes, and both need to be further understood.
If you still have doubts, I would strongly suggest to open a ticket with SAS Technical Support to analyze your report & data.
To answer your initial question, directly: I work with many clients and SAS deployments (Viya and not Viya), and while, as discussed above, you may experience these discrepancies in the visualization (as you can see in any other visualization tool), I have never seen this kind of issue with the data+calculations.
The responsibility of the visualization lays on the shoulders of the author of the report, except on very rare cases where there might a software defect, which I doubt very much is the case. Yet, if you want to challenge this aspect, SAS Technical Support will help you figure it out.
@Naiii wrote:
The numbers do not contain decimals
In that case, it sets total = 7.
Pictures are not data, or very good proof of what values may be involved. Especially with what appears to be a very heavily edited picture.
Can you change its format to Float12.2, then post a screenshot of the results? Visual Analytics uses the BEST12. format by default which may not necessarily include decimals.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.
Find more tutorials on the SAS Users YouTube channel.