ColumnsCalculated

Z Solvertech
Verze z 19. 8. 2022, 09:37, kterou vytvořil Jana.safferova (diskuse | příspěvky) (založena nová stránka s textem „3 - Type of the column to use as a variable“)
(rozdíl) ← Starší verze | zobrazit aktuální verzi (rozdíl) | Novější verze → (rozdíl)
Skočit na navigaci Skočit na vyhledávání
Jiné jazyky:


It is used to calculate based on some condition.

Explanation:

<string>1;2;3;4;;5</string>

1 - Type of column into which we want the condition to be written

2 - Name of the column where we want the condition to be written

3 - Type of the column to use as a variable

4 - The name of the column we will use as a variable

5 - condition (separated from the input columns by two semicolons) - Write here the previous type and the column name together as one word.

Example:

<string>stop2;workingtime;stop2;duration;;stop2duration</string>

In this case, the value that is in the duration column in track 2 is written to the workingtime column in track 2.

Other condition options:

Simple Calculation:

<string>stop2;demand1;stop1;demand1;;-stop1demand1</string>

Here the minus value from demand 1 track 1 is written into demand 1 track 2

Complicated condition:

<string>job;specialcodes;stop1;address;job;specialcodes;;stop1address==Opatovská cesta 10. 04011 Košice?jobspecialcodes-kosice:jobspecialcodes</string>

If the value "Opatovská cesta 10. 04011 Košice" appears in trace 1 of the adress column, the value from the specialcode and additionally "-kosice" will be written into the specialcodes column. If this condition is not met, only special codes will be written. In this condition, job;specialcodes is used once as the type/name of the column to overwrite the condition and a second time as a variable that is overwritten in this column - so it is necessary to have the job;specialcodes column in the string twice - once at the beginning (type/name of the column) and a second time as a variable.

Events Containing Time

If it is necessary to assess events that contain time information, "XXX" is used instead of a colon to separate the events.

<string>dynamic;cas_celkem;dynamic;naklad;;dynamicnaklad&gt;100?1400XXX1700</string>

If the value in the dynamic column "load" is greater than 100, the dynamic column cas_celkem will be set to 14:00, otherwise to 17:00.

Determine if the field is empty

If you need to determine whether a field is empty or contains any value, the syntax is:

<string>stop1;name;stop1;name;;stop1name==?NIKDO:stop1name</string>

If the "name" field of track 1 is empty, the value "NONE" is filled in, if it is not empty, it keeps its value.

Assigning a colour to an unserved job

If it is necessary to assign a color to an unserved job, it is necessary to create a dynamic column "color", optimally setting it to the default color "Red".

It is then possible to change the colour of the job using conditions. Note that the colour notation is different than in AfterConsolidationColumnsCalculated.

If you want to assign a legend to a colour, read Displaying a colour legend on the map

Example:

1 <string>dynamic;color;dynamic;color;stop1;demand1;;stop1demand1&lt;51?LawnGreen:dynamiccolor</string>

2 <string>dynamic;color;dynamic;color;stop1;demand1;;stop1demand1&gt;50?SkyBlue:dynamiccolor</string>


If the job has demand1 less than 51, the color of the uncirculated job is set to "LawnGreen". If larger, it is set to "SkyBlue".

Colours:

TAS Pokroile Pluginy Input, Output Import ScenarioImporter ColumnsCalculatedart-color-table.png











Swapping of delivery and collection

If you need to swap delivery and collection, please follow the Swap collection and delivery

the "?" character separates the condition from the event

the ":" character separates events from each other

the character "XXX" separates the time events from each other

the "==" character determines whether the condition is equal to the given value

the "&gt;" character determines whether the condition is greater than the given value

the character "&lt;" determines whether the condition is smaller than the given value

the character "&gt;&lt;" determines whether the condition contains the given value