Calculating with number sequences

This article explains how to perform calculations and apply logical operations on number series using the CSV data type, including examples for functions such as average, standard deviation, addition, multiplication, and conditional comparisons.

If you specify csv as the data type for a parameter, you can enter several values in succession, as a series of numbers, in an input field.

Number series are usually imported from measuring instruments, but can also be entered manually (when entering manually, the individual values are entered separately with the Enter key).

In the figure above, the numerical series burning rate was calculated from the numerical series burning distance and burning time.
Burning rate = (Burning distance / Burning time)*60

This was done by dividing the 1st value of the burning distance by the 1st value of the burning time and multiplying by 60 (254 / 202)*60 = 75.45.
Divide the 2nd value of the burning distance by the 2nd value of the burning time and multiply by 60 (123 / 202)*60 = 36.53.
etc.

The formula is as follows:

csvmultiply(csvdivide(m['BV']['1'], m['BV']['2']), 60)

Functions for calculating with number sequences

Function Designation Example
average average(Number series) forms the average value of the number series mittelwert(m['BV']['1']) = average(254; 123; 100; 254; 254) = 197
median median(Number series) forms the median of the number series. If the number series consists of an even number of numbers, median calculates the average of the two middle numbers. median(m['BV']['1']) = 254
stabw or stabws stabw(Number series) forms the standard deviation of a sample: stabw(m['BV']['1']) = 78,47
stabwn stabwn(Number series) is the standard deviation of a population: stabwn(m['BV']['1']) = 70,19
summe summe(Number series) forms the sum of a number series summe(m['BV']['1']) = 985
produkt produkt(Number series) forms the product of the Number series produkt(m['BV']['1']) = 201560887200
min min(Number series) returns the smallest number of the number series min(m['BV']['1']) = 100
max max(Number series) gives the largest number of the Number series max(m['BV']['1']) = 254
first first(Number series) returns the first value of a number series first(m['BV']['1']) = 254
last last(Number series) returns the last value of a number series last(m['BV']['1']) = 254
csventry csventry(Position, values) returns the value at a certain position of a number series. The position starts counting at 0. e.g.: csventry(this(1), this(0)) returns the following result:
csvadd csvadd(Number series A, Number series B) adds the 1st value of Number series A to the 1st value of Number series B, etc. and returns a Number series again. csvadd(m['BV']['1'], m['BV']['2']) = 456; 325; 150; 456; 456
csvminus csvminus(Number series A, Number series B) subtracts the 1st value of Number series A from the 1st value of Number series B, etc. and returns a Number series again. csvminus(m['BV']['1'], m['BV']['2']) = 52; -79; 50; 52; 52
csvmultiply csvmultiply(Number series A, Number series B) multiplies the 1st value of Number series A by the 1st value of Number series B, etc. and returns a Number series again. csvmultiply(m['BV']['1'], m['BV']['2']) = 51308; 24846; 5000; 51308; 51308
csvdivide csvdivide(Number series A, Number series B) divides the 1st value of Number series A with the 1st value of Number series B, etc. and returns a Number series again. csvdivide(m['BV']['1'], m['BV']['2']) = 1,26; 0,61; 2,00; 1,26; 1,26
csvpow csvpow(Number series A, Number series B) Takes the 1st value of number series A as the base and the 1st value of number series B as the power, etc. and returns a number series again. csvpow(10, 3) = 1000
csvanzahl csvanzahl(Number series) returns as a result the number of numbers in the Number series csvanzahl(1,26; 0,61; 2,00; 1,26; 1,26) = 5
csvverketten csvverketten(Character series A, Character series B) allows the concatenation of two character series. To concatenate several character series, this function can be nested several times: csvverketten(Character series A, csvverketten(Character series B, Character series C)) csvverketten(15; 16, 'mg/l') = 15mg/l; 16mg/l
csvmittelwert csvmittelwert(Data series A, Data series B,...) allows calculation of the mean for each row of multiple data series. csvmittelwert(5;10,15;20) = 10;15
csvmedian csvmedian(Data series A, Data series B,...) allows determination of the median for each row of multiple data series. In case of an even number of data series, the mean of the middle values is calculated. csvmedian(5;10,15;20,20;25) = 15;20
csvstabw csvstabw(Data series A, Data series B,...) Determines the standard deviation for each row of multiple data series. csvstabw(1;1,1.5;2,2;3) = 0.5;1
csvstabwn csvstabwn(Data series A, Data series B,...) Determines the population standard deviation for each row of multiple data series. csvstabwn(1;1,1.5;2,2;3) = 0.41;0.82
csvstabws csvstabws(Data series A, Data series B,...) Determines the sample standard deviation for each row of multiple data series. csvstabws(1;1,1.5;2,2;3) = 0.5;1
csvround csvround(Data series, Number of decimal places) Rounds a floating-point value for each row of a data series. csvround(5.42;4.37,1) = 5.4;4.4
csvroundsig csvroundsig(Number series, Number of significant digits)
Rounds a number for each row to the defined number of significant digits.
roundsig(123; 12.3; 1.23; 0.123; 0.0123; 0.0123; 0.00123, 2) = 120.00; 12.00; 1.20; 0.12; 0.01; 0.01; 0.00;
csvlog csvlog(Data series) natural logarithm for each row of a data series. csvlog(10;15) = 2.3026;2.7081
csvlog10 csvlog10(Data series) Logarithm base 10 for each row of a data series. csvlog10(10;15) = 2.3026;2.7081
csvexponentialformat csvexponentialformat(Data series) The numbers are displayed in exponential notation (scientific notation) with one decimal place for each row of a data series. csvexponentialformat(1005;3400) = 1.0 x 10^3;3.4 x 10^3
csvlinks csvlinks(String, Number of characters) Cuts characters from the left for each row of a data series. csvlinks(Hello;World,3) = Hel;Wor
csvrechts csvrechts(String, Number of characters) Cuts characters from the right for each row of a data series. csvrechts(Hello;World,3) = llo;rld
csvmin csvmin(Number series A, Number series B, ...) returns, for each row, the smaller of the two values from Number series A and Number series B csvmin(1;2;3, 3;2;1) = 1;2;1
csvmax csvmax(Number series A, Number series B, ...) returns, for each row, the larger of the two values from Number series A and Number series B csvmax(1;2;3, 3;2;1) = 3,2;3
csvzahlenformat csvzahlenformat(Number series, Decimal places, Decimal separator)
⚠️ Note: The numbers are stored as a string. If further calculations are to be performed with these numbers, the comma will not be recognized as a decimal separator and must be replaced with a period using csvwechseln() before calculating.
The numbers are displayed with the specified number of decimal places and decimal separator.
Optionally, a thousands separator can also be defined: csvzahlenformat(Number, Decimal places, Decimal separator, Thousands separator).
csvzahlenformat(1.23; 234.12; 23.35; 1234567.35; 0.00, 2, '/', '$') = 1/23; 234/12; 23/35; 1$234$567/35; 0/00
csvwechseln csvwechseln(Number series, Old text, New text) replaces old text in the number series with new text, for each row csvwechseln(abcde; Tada; Blubb; 0.00, a, z) = zbcde; Tzdz; Blubb; 0.00
csvasc csvasc(Number series) sorts a mixed series of numbers and text in ascending order: numbers first in ascending numerical order, then text in ascending alphabetical order csvasc(3; 0; a; Hallo) = 0; 3; a; Hallo
csvdesc csvdesc(Number series) sorts a mixed series of numbers and text in descending order: text first in descending alphabetical order, then numbers in descending numerical order csvdesc(3; 0; a; Hallo) = Hallo; a; 3; 0
csvIstzahl csvIstzahl(Number series) checks, for each row, whether the value is a number, and returns 1 (number) or 0 (not a number) csvIstzahl(1; 1,23; 0; abc; pewpew; eins; 0) = 1; 1; 1; 0; 0; 0; 1
csvabs csvabs(Number series) returns, for each row, the absolute value of a number; for non-numeric values the result remains empty csvabs(0; 12,34; 1,99; 1234,68; abc; pewpew) = 0; 12,34; 1,99; 1234,68; ;
csvsqrt csvsqrt(Number series) returns, for each row, the square root (rounded to 2 decimal places) of a number; for non-numeric values the result remains empty csvsqrt(0; 1; 2; 12,34; 1,99; 1234,68; abc; pewpew) = 0; 1; 1,41; 3,51; 1,41; 35,14; ;
csvlaenge csvlaenge(Text) calculates, for each row, how many characters are in the text csvlaenge(+++; Pew) = 3; 3
csvwert csvwert(Text)
Converts text into a decimal number, for each row.
wert('< 0,25 mg/l'; >123; pew) = 0.25; 123; 0

By combining the above functions, the above calculation of the firing rate can be realised as follows:

Burning rate = csvmultiply(csvdivide(m['BV']['1'], m['BV']['2']), 60) = 75,45; 36,53; 120,00; 75,45; 75,45

Logical operations with number series

Function Designation Example
csvwenn csvwenn(Expression, a, b) checks line by line whether the expression (based on the csvvergleich) is 1 (true) or 0 (false) and then returns the number from the number series a or b (a if the value is true (1) and b if the value is false (0)). csvwenn({0, 1, 1, 0},{1, 2, 3, 4},{55, 66, 77, 88}) = {55, 2, 3, 88}
csvvergleich csvvergleich(a, Comparison operator, b) compares a and b line by line based on the comparison operator (>, <, <=, >=, !=, ==) and returns 0 (false) or 1 (true). csvvergleich({10, 11, 12, 13},'<',{12, 12, 12, 12})={1,1, 0, 0}
csvund csvund(a, b) forms a logical AND operation between a and b line by line. (Used to link two csvvergleich within a csvwenn query). csvund({0, 0, 1, 1}, {0, 1, 0, 1}) = {0, 0, 0, 1}
csvoder csvoder(a, b) forms a logical OR operation between a and b line by line (used to link several csvvergleich within a csvwenn query). csvoder({0, 0, 1, 1}, {0, 1, 0, 1}) = {0, 1, 1, 1}
csvinverter csvinverter(a) inverts a line by line (0 becomes 1, 1 becomes 0). csvinverter({0, 1, 1, 0}) = {1, 0, 0, 1}

Example of logical operations with number series

csvwenn and csvvergleich are mostly used in the following combination:

csvwenn(csvvergleich(a, Comparison operator, b), a, b)

Whereby a and b is a number series and (>, <, <=, >=, !=, ==) are used as comparison operators.

The following is an example of how we compare the number series a and b and then return the larger value line by line:

a = {1, 3, 4}
b = {7, 1, -1}

csvwenn(csvvergleich(a, '>', b), a, b) = {7, 3, 4}

This result comes about because the result of the csvvergleich looks like this:
csvvergleich({1, 3, 4}, '>', {7, 1, -1}) = {0, 1, 1}

Application example csvund
→ csvund requires that both csvvergleich conditions are true
csvwenn( csvund( csvvergleich(a, '>' , 0), csvvergleich(b, '>', 0) ), '<0', csvadd(a,b) ) = {8, 4, '<0'}

Related Topics:

Last change: 09/02/26

General information

Supplier evaluation

Material

Employees

Customers

Orders

Samples

PDF templates

Assets

Recipes

Reports

Report table editor

Interfaces

Kompetenzen

AI functions

Introductory phase

Query reports

Templates

Client zone (optional)

Offers

Invoices

Parameters

Calculating with parameters

Webservices

Transformationscode

Test plans / limit values / specifications

Documents control

Questions and answers

Equipment

Trainings

8D-report

Others

File management

Processes