BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
saunvida
Fluorite | Level 6

Hi SAS Community,

I’m working with SAS Intelligent Decisioning on Viya 4 to build a decision flow that includes a data query object. My goal is to assign coefficients to each policy based on the Sum Insured value.

 

I have a policy data table as follows:
Policy_ID Vehicle_Sum_Insured
1 1050
2 2000
3 3050
4 3000
5 1006


Additionally, I’ve created a separate SAS table that categorizes Sum Insured values into buckets with corresponding coefficients by various types. This table is getting used by data queries to pull appropriate coefficients for each policy.

SAS data table.png

 

 

My code: 

Query.png

 

The issue: I’ve successfully written a data query to fetch the appropriate coefficients for each policy based on type and the Sum Insured bucket. When I run the file with just one query, I am able to fetch the values of coefficients. However, when I attempt to add two or more queries in the same data query file, I encounter an error.

 

Details of the error message are as follows:

 

Error 1.png

 

(RHS extension of the above error message)

Error 2.png

 

Has anyone experienced similar issues with multiple data queries in one file? Any help would be greatly appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions
DeanTaplin
SAS Employee

The Data Query node is designed to run a single query that will return the result either as a data grid or a list of scalar variables. You cannot run multiple queries.

 

Here are a couple of ideas to consider:

  1. You could look at using multiple data query nodes in your decision, with a single query for each type, then in a subsequent ruleset or DS2 code file you could combine the results from those data query nodes into one.
  2. Another possible option to consider is a Data Query node that does not query on type, and then in a subsequent node have some logic that splits the result based on the type returned.

View solution in original post

1 REPLY 1
DeanTaplin
SAS Employee

The Data Query node is designed to run a single query that will return the result either as a data grid or a list of scalar variables. You cannot run multiple queries.

 

Here are a couple of ideas to consider:

  1. You could look at using multiple data query nodes in your decision, with a single query for each type, then in a subsequent ruleset or DS2 code file you could combine the results from those data query nodes into one.
  2. Another possible option to consider is a Data Query node that does not query on type, and then in a subsequent node have some logic that splits the result based on the type returned.

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

Register now

Discussion stats
  • 1 reply
  • 1491 views
  • 1 like
  • 2 in conversation