BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
VVDR
Obsidian | Level 7

Hi All,

In SAS DI, where can I use calculated column(newly derived in the same block) in SAS DI.

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Rama_V
Obsidian | Level 7

Hi VVDR,

 

I mean you are referring calculated column in SQL and applying in SQL or Extract transformation.

As in normal SQL, calculated columns are created using aggregated functions. You can use them in output under "select" part of SQL with user defined name for column or under "Having" part of SQL to filter after calculation. Under Having part, referring column name defined in select part for aggregate function need to be prefixed with "Calculated" word. 

 

Same applies in DI Studio, navigate to the SQL transformation to select => mappings there you can create new column and write the aggregate function under expression. 

 

View solution in original post

1 REPLY 1
Rama_V
Obsidian | Level 7

Hi VVDR,

 

I mean you are referring calculated column in SQL and applying in SQL or Extract transformation.

As in normal SQL, calculated columns are created using aggregated functions. You can use them in output under "select" part of SQL with user defined name for column or under "Having" part of SQL to filter after calculation. Under Having part, referring column name defined in select part for aggregate function need to be prefixed with "Calculated" word. 

 

Same applies in DI Studio, navigate to the SQL transformation to select => mappings there you can create new column and write the aggregate function under expression. 

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1236 views
  • 1 like
  • 2 in conversation