Joined: 07 Oct 2009
Location: United States
Online Status: Offline
Posts: 26
Topic: How to get a conditional variable to 'stick' Posted: 12 Apr 2010 at 9:20am
I'm trying to write a formula to create a variable that tracks the creation date of an order. The purpose is to subtract the creation date from the date the parts are moved to the next operation to get a 'response time' metric.
There are two types of transactions that I have to deal with: C (create/change) and N (next operation). All of these transactions exist on the same table, so I tried setting a variable according to the transaction type:
"global datetimevar creationdate:= if {matltran.trans_type}="C" then {matltran.trans_date};"
I then have a formula that does the math to find the response time as long as there were pieces move to operation 20. The problem I'm having is that the variable resets to 0 if the transaction isn't C, so it doesn't work right if the transaction I'm looking for isn't the next one in the list.
I need to find a way to tell the variable to keep its current value if the trans_type is not C.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum