Expand my Community achievements bar.

SOLVED

Subtraction on profile attribute in segment builder

Avatar

Level 9

I have got profile attribute with end date of subscription. How to subtract this attribute from current day in segment builder?

Michael_Soprano_0-1737322212645.png

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor and Adobe Champion

Dear @Michael_Soprano ,

Why do you want to subtract the same from the current day?

Are you trying to create an audience based on their subscription start and end date?

If Segment UI is not helping, try creating the segment using Segment API with PQL.

A similar sort of question was asked in the RTCDP community, and the person who raised the question came up with an answer by himself (thanks to him). Checkout.

Link: https://experienceleaguecommunities.adobe.com/t5/real-time-customer-data-platform/create-audience-wh...

Thank You, Pratheep Arun Raj B (Arun) | NextRow Digital | Terryn Winter Analytics

View solution in original post

6 Replies

Avatar

Level 9

Hi @Michael_Soprano ,

I don't believe you can subtract DateTime attributes like you are expecting in AEP segments. What you can do is use one of the Time constraints to validate the segments against these fields like if the subscription date is today or in next 15 days etc. See if one of these time constraints can serve your segmentation requirements.

Cheers!

Avatar

Correct answer by
Community Advisor and Adobe Champion

Dear @Michael_Soprano ,

Why do you want to subtract the same from the current day?

Are you trying to create an audience based on their subscription start and end date?

If Segment UI is not helping, try creating the segment using Segment API with PQL.

A similar sort of question was asked in the RTCDP community, and the person who raised the question came up with an answer by himself (thanks to him). Checkout.

Link: https://experienceleaguecommunities.adobe.com/t5/real-time-customer-data-platform/create-audience-wh...

Thank You, Pratheep Arun Raj B (Arun) | NextRow Digital | Terryn Winter Analytics

Avatar

Level 4

Nice reference @PratheepArunRaj!

I have tooled the the logic that was referenced to this use caseThis would return any records that have an endDate of 5 days prior. 

I think that this should accomplish what @Michael_Soprano is trying to do! 

"expression": {
"type": "PQL",
"format": "pql/text",
"value": "select 'insertYourSubscriptionPathHere' from 'routeitHere' where SECONDS_BETWEEN(XXX.endDate, now) / 86400 = 5"
}
 

Avatar

Level 9

@Michael_Soprano  if possible move the event attribute as it is time-series type and the profile will store on one value not the historical - hence would not give you the expected segmentation.. 

Avatar

Employee

are you looking for profiles which have an upcoming subscription end date which is N days from current date?

Avatar

Administrator

@Michael_Soprano 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