Jump to content

Best way to generate calc based on multiple criteria

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

Recommended Posts

Whats the best way to generate a calc based on the following criteria. I should say I now have it set up as a Case based Calc spelling out each of the possible scenarios. I am trying to figure out how long it takes to produce a job.

We have 3 pieces of equipment. Press1, Press2, Press3. Each press can operate 3 differnt ways, Style1, Style2, Style3. My case is written as(shortend for this question);)

Case(Press1 and Style1=1; Press1 and Style2=2; Press1 and Style3=3; Press2 and Style1 = 4 and so on. I feel like there should be a better way to do this.

Link to comment
Share on other sites


I have a similiar scenario in my solution. I decided not to use a straight calc field but instead (for other reasons) to script the calculation.

In my script I decided to calculate the setups seperately from the run times. This gave two advantages.

Firstly, from a developers point of view the calcs were fairly easy to construct and follow and secondly from the users point of view I could display the results seperately when giving a breakdown of the total calculation. The disadvantage of course is that the user has to press a button to do the calc but as I said, for other reasons I decided that this was the best way for me.

If scripting is not an option in your case you could achieve the same advantages by using three calc fields. One to calc the make readies, one to calc the run times and one to add the two together if necessary. Other than that it is down to a single calc field that as you discovered can soon get very long and if your process is anything like mine (we are printers) with the other factors that might affect the calc can soon get very complex and almost impossible to unravel when you revisit them after the initial construction. I have had more than my fair share of 'Bloomimg heck did I write that one!!' moments, hence my decision to break the calc down a little.



Link to comment
Share on other sites

Hi Phil, we are printers as well. As you guessed, I am trying to calc makereadies for each press along with run times based on colors and print styles. At this point, we only have 3 presses and really 3 print styles, Sheetwise, work&turn or perfect. I have the press time field set up to select an option from a Case calc. Do you have an example of the scripted calc you wrote I could look at?

Link to comment
Share on other sites

You might try using the Let function to simplify your calculation. E.g.;)

Let( [press = Case(PressChoice="Press1";2000;PressChoice="Press2";5000;PressChoice="Press3";10000) ;

      style = Case(StyleChoice="Sheetwise";123;StyleChoice="work&turn";234;StyleChoice="perfect";345)] ; 

press + style   // or whatever your calc is


Another option might be to put the presses and styles in their own little tables and use relationships to pull in the numbers for your calc.

Link to comment
Share on other sites

This topic is 5700 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

  • Create New...

Important Information

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