Subtraction on profile attribute in segment builder | Community
Skip to main content
Michael_Soprano
Level 10
January 19, 2025
Solved

Subtraction on profile attribute in segment builder

  • January 19, 2025
  • 5 replies
  • 929 views

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

 

Best answer by PratheepArunRaj

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-where-profiles-having-an-active-subscription/m-p/731961#M1245

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

5 replies

Harveer_SinghGi1
Community Advisor
Community Advisor
January 20, 2025

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!

PratheepArunRaj
Community Advisor and Adobe Champion
PratheepArunRajCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
January 21, 2025

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-where-profiles-having-an-active-subscription/m-p/731961#M1245

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

Thank You, Pratheep Arun Raj B (Arun) | Xerago | Terryn Winter Analytics
TylerKrause
Adobe Champion
Adobe Champion
January 28, 2025

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"
}
 
RiteshY18
Community Advisor
Community Advisor
January 23, 2025

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

brekrut
Adobe Employee
Adobe Employee
January 23, 2025

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

kautuk_sahni
Community Manager
Community Manager
January 29, 2025

@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