BookmarkSubscribeRSS Feed
Babloo
Rhodochrosite | Level 12

Appreciate if someone of you guide me to derive the expression with the following condition. I'm using DI Studio 4.21.

 

I want to derive the new variable KNDATL and mapping is to take the policy issue date from POLICY dataset.  If this policy issue date is empty than check if the knkatd (it's a another variable) of current run month <> knkatd of previous month.  If there is difference then take end of month as KNDATL; if no difference, take the same value for KNDATL as previous month. Data for knkatd looks like

1 to 12 (Jan as 1 to Dec as 12)

2 REPLIES 2
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Again, please post test data in the form of a datastep and show what you want out at the end.  SAS is a data based programming language, without this it is not possible to fully answer any question, this has been mentioned many times.

LinusH
Tourmaline | Level 20
This is quite advanced logic, and hard to guide for a DI Studio use case. But doesn't seem like a single derived expression to me (and yes, source and sample output data would help).
You probably need a join, perhaps multiple times with the same source table.
Data never sleeps

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
  • 571 views
  • 0 likes
  • 3 in conversation