8 Replies Latest reply on Aug 16, 2018 8:31 AM by Joe Oppelt

# Expected closing parenthesis for the expression starting at character 1

Hello.  I am still in the early stages of learning Desktop and I running into the error message above in this equation:

(DATEDIFF('day',ATTR([Loan Events (3)].[Date Completed]),[Date Modified]) -

(7-DATEPART('weekday',ATTR([Loan Events (3)].[Date Completed])) -

DATEPART('weekday',[Date Modified])

) / 7*5

+ MIN(5,(7-(DATEPART('weekday',ATTR([Loan Events (3)].[Date Completed]))))

+ MIN(5,(DATEPART('weekday',[Date Modified])-1))

-1

Any help is greatly appreciated!

Thanks!

• ###### 1. Re: Expected closing parenthesis for the expression starting at character 1

Take individual parts of that syntax and make sure they're correct by themselves.

For the record, in other threads when I talk about complex calcs I say that my preference is to make intermediate calcs to compartmentalize the whole mess.  then use those intermediate calcs in place of all those embedded clauses.

So, for instance, I might make this one calc:

DATEDIFF('day',ATTR([Loan Events (3)].[Date Completed]),[Date Modified])

And then plug my calc into that slot in the larger equation.

1 of 1 people found this helpful
• ###### 2. Re: Expected closing parenthesis for the expression starting at character 1

Well, in this case, the error message is telling you exactly what the problem is.  You don't have a closing bracket for the opening bracket - the first character in your calculation.

Question is whether it should go before or after the -1...

• ###### 3. Re: Expected closing parenthesis for the expression starting at character 1

Hi Damon,

You just need to check if corresponding brackets are in proper position or not  '('  ')'

Try below -----

DATEDIFF('day',ATTR([Loan Events (3)].[Date Completed]),[Date Modified]) -

(7-DATEPART('weekday',ATTR([Loan Events (3)].[Date Completed])) -

DATEPART('weekday',[Date Modified])

) / 7*5

+ MIN(5,(7-(DATEPART('weekday',ATTR([Loan Events (3)].[Date Completed])))))

+ MIN(5,(DATEPART('weekday',[Date Modified])-1))

-1

You may find different errors after that though.

Thanks,

Ritesh

1 of 1 people found this helpful
• ###### 4. Re: Expected closing parenthesis for the expression starting at character 1

Michael Gillespie wrote:

Question is whether it should go before or after the -1...

Or after the 7.5 ...

• ###### 5. Re: Expected closing parenthesis for the expression starting at character 1

Touché...

• ###### 6. Re: Expected closing parenthesis for the expression starting at character 1

Unfortunately none of these recommendations resolved the issue.  Do you have any other suggestions?

• ###### 7. Re: Expected closing parenthesis for the expression starting at character 1

Hello Damon,

could you share the .twbx please.

Cheers.

• ###### 8. Re: Expected closing parenthesis for the expression starting at character 1

Damon -- Did you make each of those components its own calc?  I would make 5 calcs.

Then you can get the parens right.

You would have [A]-[B]-[C]/7.5 +[D]+[E]

Then you can see where you need the parens for the proper order of evaluation among those 6 tokens.  Once you have that, you could replace each temp calc with the code from the respective calcs right back into the overall calc if you want it all expanded out in your final calc.