Example 1 Subresults

A Tariff can consist of several sub results. Here we show all available sub results, how they work and how they are joined together as a usable Tariff:

An introduction how to start creating a Tariff can be found here.

We're beginning with some easy examples, later on we will use some real world data for creating a Complex Rate.

The most simple sub result type is called Lump Sum. Here we don't need to define any criterion to making it working. Please note that the currency has to be mentioned in the Rate field:

images/confluence/download/attachments/17960241/Tariff_Maintenance_Lumpsum.jpg

As soon as the Lump Sum is created it has to be integrated into the Item Calculation by entering the name of the lump sum:

images/confluence/download/attachments/17960241/Tariff_Maintenance_ItemCalculation1.jpg

If a Tariff matches to an Offer or Port Call can be checked out by using the Preview...

images/confluence/download/attachments/17960241/Tariff_Maintenance_Preview1.jpg

...and selecting the desired Offer or Port Call:

Tariff_MaintenancePreview3

Another sub result type is called Per. A Per takes effect in combination with a criterion. The criterion can be chosen by clicking the Select button:

images/confluence/download/attachments/17960241/Tariff_Maintenance_PerSelect.jpg

A working Per could look like the example below. Please note that we're comparing data with different dimensions here: Deadweight is in tons, USD is a currency. To get a proper result we have to eliminate the tons from the vessel.deadweight by dividing the term by [to]:

images/confluence/download/attachments/17960241/Tariff_Maintenance_Per.jpg

The sub result has to be moved by drag & drop onto the yellow square, comma separated, then adjust the curly bracket!)

images/confluence/download/attachments/17960241/Tariff_Maintenance_PerSubresult.jpg

As soon as this Per is included in the Item Calculation (here by using the subresult view in the Item Calculation dialogue)...

images/confluence/download/attachments/17960241/Tariff_Maintenance_ItemCalculation2.jpg

...the Per can take effect in the Preview (vessel deadweight in the used Port Call is 3.000 tons):

images/confluence/download/attachments/17960241/Tariff_Maintenance_Preview2.jpg

A more complex sub result type is Formula (for more details on syntax, functions, currencies and units see here).

For this example we want to calculate the length of the vessel multiplied by 2.50 USD plus the vessel's draft multiplied by 3.75 USD.

images/confluence/download/attachments/17960241/Tariff_Maintenance_Formula1.jpg

Please note:

  • vessel length and vessel draft have the dimension "meter" (see vessel dialogue in settings section), USD is a currency. To get the result in USD we have to divide each sub formula by /[m].

  • the use of the function "sum" is not mandatory here but makes the sub formula more readable.

  • separator for values is "." , not "," like in some countries/cultures.

  • in this case there are exemplary two ways to spell this sub formula: "sum(Vessel.Length * 2.50 USD + Vessel.Draft * 3.75 USD) / [m]" and "sum(Vessel.Length * 2.50 USD / [m]) + sum(Vessel.Draft * 3.75 USD / [m])". The main difference is where the term gets divided by the dimension. Total is the same.

The elements for the sub formula can be inserted manually or selected by drag an drop from the "field" and/or "'Subresult" area:

images/confluence/download/attachments/17960241/Tariff_Maintenance_Formula1.jpg

To make the formula effective it has to be inserted into the Item Calculation:

images/confluence/download/attachments/17960241/Tariff_Maintenance_ItemCalculation3.jpg

As soon as this is done the formula can take effect in the Preview.

Please note that the total is individual, related to the data in the underlying Port Call:

Tariff_Maintenance_preview4.jpg

Next we take a Boat Tariff as an example for creating a working Tariff with some certain complexity, basing on real world data:

images/confluence/download/attachments/17960241/Tariff_Maintenance_Tariff_example.jpg

This tariff describes the fees when arriving at Ex Marine South Pier from Ports mentioned in row "Port Code" and/or "Location Name". The row "*AOH" describes surcharges which will be handled later in this example.

For creating complex rates we use the sub result type "complex rate":

images/confluence/download/attachments/17960241/Tariff_Maintenance_CRate1.jpg

The table from the list can be transferred to the Complex Rate table which looks like this:

images/confluence/download/attachments/17960241/Tariff_Maintenance_CRate2.jpg

The following criteria is used for this example: the Port Code from the list as Location.Code in SAPAS (note: we assume that these locations are existing in Settings/Location, see here how to create a Location). The port of destination is our NextLocation.Code (see here how to create a shipping route in an Offer, similar for Port Call). Used operator for both criteria is "=" which could be translated to "when Location.Code is "AEHA" and NextLocation.Code is "EMP" then the fee is 150 USD".

A Criterion can be selected by clicking the edit button:

images/confluence/download/attachments/17960241/Tariff_Maintenance_CRate6.jpg

The Row "Result", here named with "fee", reflects the fee to be paid from the row "Ex Marine South Pier" on the list (*AOH from the list and AOHSurcharge from the Complex Rate will be handled later on).

As soon as we have finished our Complex Rate we'll have to include it in the Item Calculation. Important: the wanted result from the Complex Rate table is the row "fee" which is stated like this (note the "." as separator):

images/confluence/download/attachments/17960241/Tariff_Maintenance_CRate3.jpg

The matching criteria is "previous Port" and "Next Port" from the selected Port Call:

images/confluence/download/attachments/17960241/Tariff_Maintenance_CRate5.jpg

What is left is to define the AOH surcharge from the Port Tariff List which can be created like this:

Into the 1st Complex Rate we include the row "AOHSurcharge" where the specific surcharges are entered:

images/confluence/download/attachments/17960241/Tariff_Maintenance_CRate7.jpg

Nest step is to create a new Complex Rate for the surcharges. Those surcharges are taking effect when arriving at Ex Marine South Pier outside working hours. Working hours are defined as from 8am to 5:30pm. The surcharge will only be added to the Tariff as soon as ETA and ETS are after/before working hours.

The Surcharge Complex Rate looks like this:

images/confluence/download/attachments/17960241/Tariff_Maintenance_CRate8.jpg

As for the result row we refer to the formerly created Complex Rate, which was called "MarineSouthPier". From here we select row "AOHSurcharges". The entered value is:

"MarineSouthPier.AOHsurcharge" (with "." as separator).

  • ETA is chosen as first criterion, row name is "Time_from".Operator is >=. First row: Value of the first field is time(0,0,0).

  • ETA is also the second criterion, this row is named "Time_to". Operator is <=. First Row: Value of the firs field is time(7,59,59).

  • This can be read as "When ETA is bigger (later) or equal to midnight and smaller (earlier) 7:59 am the value of MarineSouthPier.AOHsurcharge will take effect". Please note: we have to take midnight as start point for our criterion because it's not possible (yet) to calculate with the time function for more than one day! That's why we have to define another row for the time between midnight and start of after working hours which is 17:31 (we work with 24h time scheme!):

  • ETA >= time(7,31,00) and ETA <= (23,59,59).

  • This can be read as "When ETA is bigger (later) or equal to 17:31 and smaller (earlier) than 23:59 am the value of MarineSouthPier.AOHsurcharge will take effect".

Next step is to include the second Complex Rate in the Item Calculation. Here we refer to the row "AOHSurcharge" by adding the value "Surcharges.AOHsurcharge":

images/confluence/download/attachments/17960241/Tariff_Maintenance_CRate11.jpg

As soon as ETA is outside working hours in our Port Call...

images/confluence/download/attachments/17960241/Tariff_Maintenance_CRate9.jpg

...the preview will show the added AOH surcharge:

images/confluence/download/attachments/17960241/Tariff_Maintenance_CRate10.jpg