Compare today to another data in AEP Audience | Community
Skip to main content
Level 3
June 10, 2024
Solved

Compare today to another data in AEP Audience

  • June 10, 2024
  • 4 replies
  • 1343 views

Hi all, 

 

Is there a way to compare if the current date (date of audience eval) is less than an imported date field in an AEP audience? We have a requirement for this, and I'm not sure how to approach it. 

 

Thanks

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by nnakirikanti

@trojan_horse This is possible, check the screenshot where you need drop these two fields in same upper container of "segment membership per namspace" container along with compare field to get required audience.

Note: "Segment membership map" should contain "ups" as string and segment membership per namspace should contain the audience id.

 

#1 Depicts addition of Segmentation status and las qualified time

#2 Depicts dragging attribute for comparison.

 

I hope this solves your need.

 

~cheers,

NN

4 replies

DavidRoss91
Community Advisor
Community Advisor
June 11, 2024

Hi @trojan_horse 

Could you potentially give a basic example of what this data your trying to compare would look like? 

Thanks,

David

nnakirikanti
Community Advisor
nnakirikantiCommunity AdvisorAccepted solution
Community Advisor
June 11, 2024

@trojan_horse This is possible, check the screenshot where you need drop these two fields in same upper container of "segment membership per namspace" container along with compare field to get required audience.

Note: "Segment membership map" should contain "ups" as string and segment membership per namspace should contain the audience id.

 

#1 Depicts addition of Segmentation status and las qualified time

#2 Depicts dragging attribute for comparison.

 

I hope this solves your need.

 

~cheers,

NN

June 28, 2024

Hi,

 

Yes, you can compare dates in Adob Experience Platform (AEP) to evaluate if the current date is less than an imported date field. Here’s a general approch:

1.
- Use a profile script to compare the current date with the imported date field.

2.
- Write a JavaScript code snippet to compare the dates.

Here's an example of how you might do it:

```javascript
// Get the current date
var currentDate = new Date();

// Get the imported date field (assuming it's stored as a string in 'YYYY-MM-DD' format)
var importedDateString = profile.attributes.importedDate; // Replace 'importedDate' with your field name
var importedDate = new Date(importedDateString);

// Compare the dates
if (currentDate < importedDate) {
return true; // Current date is less than the imported date
} else {
return false; // Current date is not less than the imported date
}
```

3. 
- Create or update the profile script in AEP to include this logic.

4.
- Test the script to ensure it correctly evaluates the date comparison.

If you need more detailed instructions specific to your AEP setup, consider reaching out to Adobe support or consulting the AEP documentation.

https://vistaroofinglincoln.co.uk/

kautuk_sahni
Community Manager
Community Manager
September 16, 2024

@trojan_horse Did you find the suggestions helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!

Kautuk Sahni