Skip to main content
Question

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

  • May 3, 2023
  • 8 replies
  • 9 views

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
  • 627 replies
  • 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
  • 10 replies
  • May 3, 2023

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
  • 627 replies
  • May 3, 2023

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
  • 10 replies
  • 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
  • 627 replies
  • 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.

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
  • 10 replies
  • May 3, 2023

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
  • 627 replies
  • May 3, 2023

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
  • 10 replies
  • 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.