BookmarkSubscribeRSS Feed
keiwo
Obsidian | Level 7

Greetings,

 

Hope everyone is doing well.

 

Below is an example of an output from SAS MA export node

 

CUSTOMER_ID Scoring_Var1 Scoring_Var2 Scoring_Var3
CUST0000001 0.98765 0.01234 0.99999

 

Question: is there a way to create a calculated field that will return the max(Scoring_Var)  for each row.

 

Thanks in advance 😁

2 REPLIES 2
mklangley
Lapis Lazuli | Level 10

Here's one way, using an array, that is suitable for any number of scoring_var# columns you have.

data have;
    input customer_id $12. scoring_var1 scoring_var2 scoring_var3;
    datalines;
CUST0000001 0.98765 0.01234 0.99999
CUST0000002 0.87654 0.76543 0.54321
    ;
run;

data want;
    set have;
    array scoring_columns scoring_var:;
    max = max(of scoring_columns[*]);
run;

 For more details, or to see a few other methods, see this link.

JamesAnderson
SAS Employee

Perhaps LARGEST() is the SQL function that would do this for you (although you will need to confirm its available in CI Studio). In a calculated item create an expression like: LARGEST(1, Scoring_Var1, Scoring_Var2, Scoring_Var3)

 

Regards

James

Review SAS CI360 now.png

 

Want to review SAS CI360? G2 is offering a gift card or charitable donation for each accepted review. Use this link to opt out of receiving anything of value for your review.

 

 

 

 

SAS Customer Intelligence 360

Get started with CI 360

Review CI 360 Release Notes

Open a Technical Support case

Suggest software enhancements

Listen to the Reimagine Marketing podcast

Assess your marketing efforts with a free tool

 

Training Resources

SAS Customer Intelligence Learning Subscription (login required)

Access free tutorials

Refer to documentation

Latest hot fixes

Compatibility notice re: SAS 9.4M8 (TS1M8) or later

 

 

How to improve email deliverability

SAS' Peter Ansbacher shows you how to use the dashboard in SAS Customer Intelligence 360 for better results.

Find more tutorials on the SAS Users YouTube channel.

Review SAS CI360 now.png

 

Want to review SAS CI360? G2 is offering a gift card or charitable donation for each accepted review. Use this link to opt out of receiving anything of value for your review.

 

 

 

 

SAS Customer Intelligence 360

Get started with CI 360

Review CI 360 Release Notes

Open a Technical Support case

Suggest software enhancements

Listen to the Reimagine Marketing podcast

Assess your marketing efforts with a free tool

 

Training Resources

SAS Customer Intelligence Learning Subscription (login required)

Access free tutorials

Refer to documentation

Latest hot fixes

Compatibility notice re: SAS 9.4M8 (TS1M8) or later

 

 

Discussion stats
  • 2 replies
  • 863 views
  • 0 likes
  • 3 in conversation