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

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