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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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