BookmarkSubscribeRSS Feed
umashankersaini
Quartz | Level 8

Hi Team,

 

I need to tag customer's transaction to the latest campaign only.

Sample files has been attached with desired result.

let me explain scenario little bit.

 

Suppose i am sending a campaign on 27NOV2020 (EVENT_CAPTURED_DT) with attribution window 27Nov2020+7days =04DEC2020(CPGN_END_DT). Now customer has shopped on 06DEC which is not part of mentioned campaign.

In this case customer would get tagged to another campaign which has end_date greater that transaction date.

In case i have sent multiple campaigns to same customer in a week (different dates) and customer has shopped then customer's transaction would get tagged to last campaign (latest).

 

Sample Files:

CPGN_ORIG - Contains campaign details

ATTRN_ATTRB - Customer's shopping details during attribution window

CPGNS_Final_Output - Required output - Customer's transaction tagged to latest campaign - sample example

 

Proc sql would be first choice as a code. Kindly read the attached file for sample data.

 

Thanks in advance.

Regards,

Uma Shanker Saini

1 REPLY 1
ChrisNZ
Tourmaline | Level 20

1. Do not send MS office files, many people will not/may not open them, and they lack any metadata anyway.

2. Reduce your problem to a small subset of example data

3. Provide that input data so we don't have to work to use it (provide it in the form of a data step or SQL create+insert)

4. Provide the desired output

5. Show what code you've tried (for both the data code and the run code, use the code icon)

 

 

 

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 Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 371 views
  • 0 likes
  • 2 in conversation