Twist Posted December 31, 2003 Posted December 31, 2003 I need to produce a result, based on the last occurance of the same result. I have a calulation that based on different criteria, dispalys different results. One of those results needs to display a different result based on what occured the last time that it occurred was. So if it was result "a" than the next time it occurs, it needs to be "b". To further explain the calculation looks something like this - If(fieldvalue = "X" and fieldvalueB = "X", "AA", If(fieldvalueA= "X" and fieldvalueC ="X", "B" etc.. The last condition needs to show "C" the first time, and "D" the next time it occurs. I think i need to have a related DB hold the result, and have it check for the previous value when it occurs next.
-Queue- Posted December 31, 2003 Posted December 31, 2003 One of those results needs to display a different result based on what occured the last time that it occurred was. If someone interprets this into English, let me know.
Lee Smith Posted December 31, 2003 Posted December 31, 2003 Hi Queue, I think he put a "Twist" to it.
-Queue- Posted December 31, 2003 Posted December 31, 2003 Apparently so. I'm also thinking that his first 'fieldvalue' should be 'fieldvalueA'. But I still can't deduce what the goal is.
BobWeaver Posted January 1, 2004 Posted January 1, 2004 I think the goal is to produce a goal, based on the last result of the same goal.
Jim McKee Posted January 1, 2004 Posted January 1, 2004 I wonder if this is actually Ugo using an alias to mess with our heads?
Charles Delfs Posted January 1, 2004 Posted January 1, 2004 I think the result is 42 To get this result set up the following calculation: Result = 42 This will produce a result based on the last result answer of .... 42. Charles
Twist Posted January 2, 2004 Author Posted January 2, 2004 For your further amusement: If( Timeframe_under30 = "X" and Purchasing20plus = "X" and Action_Rep_Lit = "X", "AA", If( Timeframe_under30 = "X" and Planning = "X" and Action_Rep_Lit = "X", "AA-", If( Timeframe_1to3mths = "X" and Purchasing20plus = "X" and Action_Rep_Lit = "X", "A", If( Timeframe_1to3mths = "X" and Planning = "X" and Action_Rep_Lit = "X", "A-", If( Timeframe_4to6mths = "X" and Purchasing20plus = "X" and Action_Rep_Lit = "X", "B", If( Timeframe_4to6mths = "X" and Planning = "X" and Action_Rep_Lit = "X", "B-", If( Timeframe_greater6mths = "X" and Purchasing20plus = "X" and Action_Rep_Lit = "X", "C", If( Timeframe_greater6mths = "X" and Planning = "X" and Action_Rep_Lit = "X", "C-", If( PurchasingLess20 = "X" and ActionC10_G9_E9a = "X", "Preferred Reseller", If( PurchasingLess20 = "X" and ActionC10_G9_E9b = "X" , "online purchase", "")))))))))) The second to last result "Preferred Reseller" can have 2 values. I need to alternate the values. So if the last time that this calculation resulted in preferred resellerA, the next time it needs to be preferrred resellerB. Am speaking in a language you can understand now?
Ugo DI LUCA Posted January 2, 2004 Posted January 2, 2004 First thing. Wouldn't it be possible to have a unique TimeFrame field ? Second, but may be related. Is your structure based upon repeating fields ? Third. What is Previous and Next depend upon your structure. Would it be that you are searching the last Record ?
DanBrill Posted January 2, 2004 Posted January 2, 2004 I don't think you'll be able to do this with a pure calculation. It will, I think, require a script that takes the value of Preferred Reseller from a field, and then using the SetField command, sets Preferred Reseller to the value that it wasn't. Something like: If [PurchasingLess20 = "X" and ActionC10_G9_E9a = "X", Preferred Reseller] If [Preferred Reseller = 'A'] SetField [Preferred Reseller = 'B'] Else SetField [Preferred Reseller = 'A'] End If The next time the script runs it will take the other Preferred Reseller Dan
John Caballero Posted January 2, 2004 Posted January 2, 2004 I think what he's getting at is looking at the Reseller value from the previous record. A scenario of what's going on would be helpful, I think.
-Queue- Posted January 2, 2004 Posted January 2, 2004 Possibly, except for all those ******* Xs. Should we assume you mean '1', as in, the field is formatted as a checkbox and has been selected? If so, you can simplify your calc to something like: Case(Action_Rep_Lit, Case( Timeframe_under30, Case(Purchasing20plus, "AA", Planning, "AA-"), Timeframe_1to3mths, Case(Purchasing20plus, "A", Planning, "A-"), Timeframe_4to6mths, Case(Purchasing20plus, "B", Planning, "B-"), Timeframe_greater6mths, Case(Purchasing20plus, "C", Planning, "C-")), PurchasingLess20, Case(ActionC10_G9_E9a, "Preferred Reseller", ActionC10_G9_E9b, "online purchase")) And we still need to know how you're determining the "last time" preferred reseller was the result.
DanBrill Posted January 2, 2004 Posted January 2, 2004 Ah, I was interpreting "last time" as the last time the activity was carried out rather than as the last record.
-Queue- Posted January 2, 2004 Posted January 2, 2004 I think it would be the 'last' record that had either preferred resellerA or B as its result. This could work with a self-relationship from the calc to itself, perhaps. But it will have to exclude the current record or Last( ) will return its value.
John Caballero Posted January 2, 2004 Posted January 2, 2004 It just seems like this could be solved by setting the value of the current record's Preseller into a global via a script and then referencing the global the next time the value was needed via another script (if it's the case that the calc needs to be stored) or directly in the calculation (if the calc doesn't need to be stored).
Newbies twist3 Posted January 2, 2004 Newbies Posted January 2, 2004 The scenario is that, my company is taking inbound phone calls from prospective buyers, who either get the phone number from the manufacturers website or recieve an marketing mail piece. They then call in and answer questions, among them a timeframe question, unit amount,and planned initiatives to purchase. Those are the questions that "qualify" a Lead Type (AA,AA-,A, etc). What i am after is,the second to last result in the calculation "Preferred Reseller" can have one of two values. This result may not happen each and every time someone calls in and answers questions. That is really determined by the amount of units they will be purchasing (less thatn 20). So, I'm not looking at the previous record, but the last record that resulted in "Preferred Reseller", as DanBrill stated. As for a unique Timeframe field,or any of those referenced, the data is exported then email to another vendor, who imports it into a sales database (like SalesForce.com)thus resrticting my formatting. Due to this, questions that have multiple choice are value list of checkboxes, and an export field substituing the breaks for comma's and no they are not based on repeating fields. I believe DanBrill is pointing me in the correct direction, using the set field script step, but am open to any other suggestions Thanks to all, Twist
-Queue- Posted January 2, 2004 Posted January 2, 2004 And the 'global' would actually need to be a 'universal', a text field in a single record prefs type file.
Recommended Posts
This topic is 7700 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now