Skip to main content
Question

Trying to all extract closed work order within a 45 day time frame.


jamesb16
Contributor
Forum|alt.badge.img+1

Having issues with info being extracted into the CLOSED 45 DAY attribute-that is created with the ATTRIBUTE CREATOR. Thanks for all recommendations.

8 replies

dustin
Influencer
Forum|alt.badge.img+31
  • Influencer
  • May 3, 2023

If you are needing the date of 45 days prior to COMPDTTM, you can use the following:

@DateTimeAdd(@Value(COMPDTTM),-P45D)

 


jamesb16
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • May 3, 2023
dustin wrote:

If you are needing the date of 45 days prior to COMPDTTM, you can use the following:

@DateTimeAdd(@Value(COMPDTTM),-P45D)

 

In Attribute Creator, I add @DateTimeNow(@Value(COMPDTTM),-P45D) since I needed on todays date-45days from the COMPDDTM column. But none of the attributes are coming over to output CSV. Any suggestions


dustin
Influencer
Forum|alt.badge.img+31
  • Influencer
  • May 3, 2023
jamesb16 wrote:

In Attribute Creator, I add @DateTimeNow(@Value(COMPDTTM),-P45D) since I needed on todays date-45days from the COMPDDTM column. But none of the attributes are coming over to output CSV. Any suggestions

I'm not sure I fully understand. Do you want to filter the entries in the CSV that are within the 45 days prior to today's date?


jamesb16
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • May 3, 2023

Yes, I need all of the closed work order from todays date within the 45 days timeframe using COMPDTTM. Yes I do.


dustin
Influencer
Forum|alt.badge.img+31
  • Influencer
  • May 3, 2023
jamesb16 wrote:

Yes, I need all of the closed work order from todays date within the 45 days timeframe using COMPDTTM. Yes I do.

Instead of an AttributeCreator, use a TestFilter with this test condition. This will also take into consideration the Closed status, so you could remove the first TestFilter.

@DateTimeAdd(@DateTimeFormat(@DateTimeNow(),%Y%m%d),-P45D) <= @DateTimeFormat(@Value(COMPDTTM),%Y%m%d)
 
AND
 
@Value(COND) = CLOS

imageimage


jamesb16
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • May 3, 2023
dustin wrote:

Instead of an AttributeCreator, use a TestFilter with this test condition. This will also take into consideration the Closed status, so you could remove the first TestFilter.

@DateTimeAdd(@DateTimeFormat(@DateTimeNow(),%Y%m%d),-P45D) <= @DateTimeFormat(@Value(COMPDTTM),%Y%m%d)
 
AND
 
@Value(COND) = CLOS

imageimage

Any other suggestions, I did the modifications as listed previously. But wasn't able to run the model.


dustin
Influencer
Forum|alt.badge.img+31
  • Influencer
  • May 3, 2023
dustin wrote:

Instead of an AttributeCreator, use a TestFilter with this test condition. This will also take into consideration the Closed status, so you could remove the first TestFilter.

@DateTimeAdd(@DateTimeFormat(@DateTimeNow(),%Y%m%d),-P45D) <= @DateTimeFormat(@Value(COMPDTTM),%Y%m%d)
 
AND
 
@Value(COND) = CLOS

imageimage

@jamesb16​ Ahh, my apologies. I had an error in my code. Correction is below.

@DateTimeAdd(@DateTimeFormat(@DateTimeNow(),%Y%m%d),-P45D) <= @DateTimeFormat(@Value(COMPDTTM),%Y%m%d)
 
AND
 
@Value(COND) = CLOS

 

 

 


jamesb16
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • May 3, 2023

Not a problem. Ran good with no errors, however all of the data were placed in <unfiltered> instead of <closed 45 days> . Any suggestion on what to look for, should I create a tester for just the CLOS (so it could filter those all those CLOS) prior to the TesterFilter and get rid of the AND clause that looks for the CLOS.


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