Skip to main content
Question

Using FME to Populate Columns based on Account Expiring


Forum|alt.badge.img

Hi all,

I am currently trying to explore within FME where I can get information of an account expiring beyond its 90 day period or close to expiring based on the AccountDate Field I have below.

I have managed to use datetimeconvertor and then used attribute manager to create 30,7, expired and expired30 days columns. I have also attempted to use the tester with following parameter @DateTimeAdd(@Value(Date ) ,P90D) but this has still not given me the result i was after.

What i am trying to get FME to do is to populate the 30 days, 7 days, expired and expired30days columns with either a Y or N based on the account age which is a range of 90 days.

8 replies

redgeographics
Celebrity
Forum|alt.badge.img+49

You'll need to convert the AccountDate to an FME Date (e.g. 20190601), then you can use the DateTimeCalculator to calculate the difference between that and the current date, like so:


Forum|alt.badge.img
  • Author
  • October 2, 2019
redgeographics wrote:

You'll need to convert the AccountDate to an FME Date (e.g. 20190601), then you can use the DateTimeCalculator to calculate the difference between that and the current date, like so:

Thanks in regards to that issue it works for the date.

I have created 3 columns in the Attribute Manager.

Based on the date column, I am trying to populate if the account has less than 30 days remaining in a 90-day cycle. The parameters I have played with a few different dates but I am only getting a Yes output.

I have tried the below but even when testing with 90days I am getting no output along with tester it's passing fine, so must be something in my conditions which are not correct.

 

 


redgeographics
Celebrity
Forum|alt.badge.img+49
fazsnatch wrote:

Thanks in regards to that issue it works for the date.

I have created 3 columns in the Attribute Manager.

Based on the date column, I am trying to populate if the account has less than 30 days remaining in a 90-day cycle. The parameters I have played with a few different dates but I am only getting a Yes output.

I have tried the below but even when testing with 90days I am getting no output along with tester it's passing fine, so must be something in my conditions which are not correct.

 

 

I would actually expect this to always return NO (since your date is always going to be less than that date plus 90 days). Instead, try DateTimeDiff:


mark2atsafe
Safer
Forum|alt.badge.img+44
  • Safer
  • October 2, 2019

Nice question. I covered a similar example in a past webinar. It was checking to see if parking tickets are 6 months past the date of offence.

You can find the webinar here: https://www.safe.com/webinars/deep-dive-fme-desktop-2017/

It includes a link to download the workspaces.

If you'd sooner read about it, rather than watch, I included the same example in a blog post that you can find here: https://www.safe.com/blog/2017/03/fme2017-dates-evangelist162/

I hope this is useful, although @redgeographics is giving you great suggestions anyway. If you are having problems I'd say use transformers (eg the DateTimeCalculator) instead of the function, because it's easier to break down into steps that way, and easier to inspect the result of each step too.


Forum|alt.badge.img
  • Author
  • October 2, 2019
redgeographics wrote:

You'll need to convert the AccountDate to an FME Date (e.g. 20190601), then you can use the DateTimeCalculator to calculate the difference between that and the current date, like so:

Thanks for your help, this helped me overall. I adjusted it also by changing range and attribute which meant i went into even more detail.


Forum|alt.badge.img
  • Author
  • October 2, 2019
mark2atsafe wrote:

Nice question. I covered a similar example in a past webinar. It was checking to see if parking tickets are 6 months past the date of offence.

You can find the webinar here: https://www.safe.com/webinars/deep-dive-fme-desktop-2017/

It includes a link to download the workspaces.

If you'd sooner read about it, rather than watch, I included the same example in a blog post that you can find here: https://www.safe.com/blog/2017/03/fme2017-dates-evangelist162/

I hope this is useful, although @redgeographics is giving you great suggestions anyway. If you are having problems I'd say use transformers (eg the DateTimeCalculator) instead of the function, because it's easier to break down into steps that way, and easier to inspect the result of each step too.

Thanks, Mark, I will have a look at this.

I managed to have a play with it, took me a little longer but I managed to get the results I was after.


mark2atsafe
Safer
Forum|alt.badge.img+44
  • Safer
  • October 2, 2019
fazsnatch wrote:

Thanks, Mark, I will have a look at this.

I managed to have a play with it, took me a little longer but I managed to get the results I was after.

Excellent. I really like the datetime functionality in FME so it's great to see someone using them for real.

Forum|alt.badge.img
  • Author
  • October 2, 2019
mark2atsafe wrote:

Nice question. I covered a similar example in a past webinar. It was checking to see if parking tickets are 6 months past the date of offence.

You can find the webinar here: https://www.safe.com/webinars/deep-dive-fme-desktop-2017/

It includes a link to download the workspaces.

If you'd sooner read about it, rather than watch, I included the same example in a blog post that you can find here: https://www.safe.com/blog/2017/03/fme2017-dates-evangelist162/

I hope this is useful, although @redgeographics is giving you great suggestions anyway. If you are having problems I'd say use transformers (eg the DateTimeCalculator) instead of the function, because it's easier to break down into steps that way, and easier to inspect the result of each step too.

Next step is to create a emailer so it automates this process :)


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings