SILog map styles: Skillnad mellan sidversioner

Från DataPolarna
Hoppa till navigering Hoppa till sök
 
(17 mellanliggande sidversioner av samma användare visas inte)
Rad 1: Rad 1:
= Conditions =
Compare operators that can be used are
* '='
* '>'
* '>='
* '<'
* '<='
Conditions can use '''and'''
<pre>
IF(inside and selected, "inside and selected", "")
</pre>
or '''or''' in the condition to check for multiple things
<pre>
IF(inside or selected, "inside or selected", "")
</pre>
Text can be concatenate using '''&'''
<pre>
storageArea.name & " " & product.name
</pre>
= Functions =
= Functions =
== ANYOF ==
== ANYOF ==
Used to check if a value is matching a list of values
'''Example'''
<pre>
IF(ANYOF(storageArea.Name, "1", "2", "3"), "1, 2, or 3", "N/A")
</pre>
== COALESCE ==
== COALESCE ==
Use the first value that isn't null.
Use the first value that isn't null.
Rad 11: Rad 42:


== IF ==
== IF ==
Match a single condition
'''Example'''
<pre>
IF(storageArea.status = storageAreaStatus.empty, "Empty", "Not empty")
</pre>
will return '''Empty''' for storage area with status empty
== IFS ==
== IFS ==
Can have multiple conditions with value, a single value at the end will be used as default value.
'''Example'''
<pre>
IFS(
storageArea.fillLevel >= 50 and storageArea.fillLevel < 80, "#4caf05",
storageArea.fillLevel >= 80 and storageArea.fillLevel < 90, "#ff8800",
storageArea.fillLevel >= 90, "#ff1500",
"#b0b0b0"
)
</pre>
will set different color depending on fill level. If it is less then 50% then it uses '''"#b0b0b0"'''
== MAX ==
== MAX ==
Returns the MAX value of two or more values
Returns the MAX value of two or more values
Rad 23: Rad 77:


== MIN ==
== MIN ==
Returns the MIN value of two or more values
'''Example'''
<pre>
MAX(42, 1, 100)
</pre>
will return 1
== NOT ==
== NOT ==
Match a negative condition
'''Example'''
<pre>
IF(NOT(storageArea.status = storageAreaStatus.empty), "Not empty", "Empty")
</pre>
Will return '''Not empty''' for any storage that doesn't have status empty
== ROUND ==
== ROUND ==
Round a value to specified number of digits
'''Example'''
<pre>
ROUND(123.456, 2)
</pre>
will return 123.46
== SWITCH ==
== SWITCH ==
Handle multiple different matches for same condition. Possible to add a default value at the end.
'''Example'''
<pre>
SWITCH(storageArea.status, storageAreaStatus.inuse, "use", storageAreaStatus.empty, "empty", storageAreaStatus.full, "full", "n/a")
</pre>

Nuvarande version från 23 oktober 2025 kl. 06.20

Conditions

Compare operators that can be used are

  • '='
  • '>'
  • '>='
  • '<'
  • '<='

Conditions can use and

IF(inside and selected, "inside and selected", "")

or or in the condition to check for multiple things

IF(inside or selected, "inside or selected", "")

Text can be concatenate using &

storageArea.name & " " & product.name

Functions

ANYOF

Used to check if a value is matching a list of values

Example

IF(ANYOF(storageArea.Name, "1", "2", "3"), "1, 2, or 3", "N/A")

COALESCE

Use the first value that isn't null.

Example

COALESCE(product.name, storageArea.name)

Will show the name of the storage area if there isn't any product in the storage area.

IF

Match a single condition

Example

IF(storageArea.status = storageAreaStatus.empty, "Empty", "Not empty")

will return Empty for storage area with status empty

IFS

Can have multiple conditions with value, a single value at the end will be used as default value.

Example

IFS(
storageArea.fillLevel >= 50 and storageArea.fillLevel < 80, "#4caf05",
storageArea.fillLevel >= 80 and storageArea.fillLevel < 90, "#ff8800",
storageArea.fillLevel >= 90, "#ff1500",
"#b0b0b0"
)

will set different color depending on fill level. If it is less then 50% then it uses "#b0b0b0"

MAX

Returns the MAX value of two or more values

Example

MAX(1, 3, 2)

will return 3

MIN

Returns the MIN value of two or more values

Example

MAX(42, 1, 100)

will return 1

NOT

Match a negative condition

Example

IF(NOT(storageArea.status = storageAreaStatus.empty), "Not empty", "Empty")

Will return Not empty for any storage that doesn't have status empty

ROUND

Round a value to specified number of digits

Example

ROUND(123.456, 2)

will return 123.46

SWITCH

Handle multiple different matches for same condition. Possible to add a default value at the end.

Example

SWITCH(storageArea.status, storageAreaStatus.inuse, "use", storageAreaStatus.empty, "empty", storageAreaStatus.full, "full", "n/a")