Jump to content

Result based on previous Result


Twist
 Share

This topic is 6598 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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 ?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

  • Newbies

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

Link to comment
Share on other sites

This topic is 6598 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.