BookmarkSubscribeRSS Feed
Ronny_Dsouza
Obsidian | Level 7

As part of a Data Job, we are including an expression node, trying to achieve a simple scoring output, the code we are using is as follows

Real Score

Score = `Triggers` *100  / `Rows_Process`

We were expecting an .decimal as part of the output, however we are getting the output as 1 or 0,  Trying to understand if we are doing anything wrong with our formulation.

appreciate any help

Ronny

1 REPLY 1
skillman
SAS Employee

Do you need parenthesis in your calculation?

Try this:

Score = (`Triggers` * 100)  / `Rows_Process`



What are the variable types for Triggers and Rows_Process?


Coercion may be causing this.


If a part of an expression is not the type expected in that context, it is converted into the correct type. A type can be coerced into some other types.

-shawn

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 744 views
  • 0 likes
  • 2 in conversation