Post

1 follower Follow
0
Avatar

Workflow Rule to update custom field based on ReportedBy date (FY & Qtr)

I am having to do a lot of manual work after I export my data into the Excel Add In in order to create lookup tables that will indicate which Fiscal quarter the reported by date is in. I kinda think I know what I need to do but I need some help.

I created a custom field at the timesheet level called Qtr - its a text field.

I am trying to create a workflow rule that basically sees what the month is and will then update the Qtr field appropriately.

THis is what I have so far and I know it is wrong:

Case(ToString(Month($ReportedDate)),"1","Q3-Jan","2","Q3-Feb","3","Q3-Mar", "4","Q4-Apr","5", "Q4-May", "6", "Q4-Jun","7", "Q1-Jul","8", "Q1-Aug", "9", "Q1-Sep", "10", "Q2-Oct", "11", "Q2-Nov", "12", "Q2-Dec")

I got this formula off of the Wiki help page but when I check syntax I get the error "Error: Case() expects number of arguments mulitply 2" ...???

Then the action is Update Field C$_Qtr but I dont know what to put in the box for the syntax.

Can anyone help me please?

Thank you
Shel

Import from old forum Answered

Please sign in to leave a comment.

4 comments

0
Avatar

Ok, so Ive worked on this a little more, and I think I am on the right track but still getting errors. I looked at the Wiki pages again and it says what I need to do is Create a custom field to extract the month in numeric and then another custom picklist field with the Q1, Q2, Q3 and Q4 in it.

So I created a custom field at the Timesheet level called Month.
The workflow rule Wiki says to use for this is Month($ReportedDate) but I am getting the error "Error: Formula evaluation result data type is Numeric instead of expected Boolean"

I dont get it, I am doing exactly what Wiki says to do. Am I on the right track and how can I get rid of this error?

Import from old forum 0 votes
Comment actions Permalink
0
Avatar

I tried something else...instead of having 2 custom fields, my thought is to have one called Qtr and write a rule to extract the month and assign the quarter through an IN statement. I put this:

If(In(Month($ReportedDate),1,2,3),"Q3",If(In(Month($ReportedDate),4,5,6),"Q4",If(In(Month($ReportedDate),7,8,9),"Q1","Q2")))

Get ERROR again! "Error: Formula evaluation result data type is String instead of expected Boolean"

This really cannot be this hard! Anyone?

Import from old forum 0 votes
Comment actions Permalink
0
Avatar

I DID IT!!

Instead of a workflow rule, when I created the custom field I have it based on that formula below:

 

If(In(Month($ReportedDate),1,2,3),"Q3",If(In(Month($ReportedDate),4,5,6),"Q4",If(In(Month($ReportedDate),7,8,9),"Q1","Q2")))

 

Import from old forum 0 votes
Comment actions Permalink
0
Avatar

Not sure if this was right or not.  Im running into the problem that I need a scheduled workflow rule to populate any Qtr field that was prior to today. Ive tried everything.

Import from old forum 0 votes
Comment actions Permalink