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

Hi there,

I'm a newbie trying to Integration Studio and trying to figure if i am able to add a new column and preset the column value to a specific value based on the data set?

I am importing csv data file through typical file reader and table loader to a destinated output table. I can add an additional column in the final output table with no issue, but trying to find the correct way to set the column value.

2 scenarios :

1. New column 'New' with all data in the column set as 1

2. Based on say a column data 'criteria', if data = 1, 'New' column set as 2, else set as 3.

How should i typically do this in the job flow diagram and execute easily at every run time depending on my files?

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Patrick
Opal | Level 21

Most transformations allow you to define expressions in the mapping tab. So for example using the table loader if you want a '1' set for a new numeric column simply tipe 1 in the expression.

For 2) map column "a" to the new column, the define an expression accordingly, eg. a case like "when a='25' then 2 else 3".

View solution in original post

2 REPLIES 2
Patrick
Opal | Level 21

Most transformations allow you to define expressions in the mapping tab. So for example using the table loader if you want a '1' set for a new numeric column simply tipe 1 in the expression.

For 2) map column "a" to the new column, the define an expression accordingly, eg. a case like "when a='25' then 2 else 3".

wsquare
Calcite | Level 5

I have read expression feature in the guide, but to be honest, for a newbie, the expression button is hardly visible for usage in those mapping screens, not to mention some of the mapping scenarios do not allow expression usage also.

Anyway, thanks for the pointer, have got that worked on upon your initial reply!

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
  • 2 replies
  • 816 views
  • 0 likes
  • 2 in conversation