svvs(X;Y;Z;I;B)
Decode and then encode a value based on an index.
Syntax
svvs(X;Y;Z;I;B)
Input
Argument | Type | Description |
---|---|---|
X |
integer | The value to decode A scalar value or the name of a column |
Y |
integer | A number or set of numbers to use a bases for the output For example, if the parsed
digits are |
Z |
integer | The number or set of numbers to add to the parsed digits For example, if the parsed
digits are |
I |
integer | The index (order) of the parsed digits The examples below show how
|
B |
integer | A number or set of numbers to use as bases to decompose the input digits.
The number |
Return Value
Returns a single output number of the transformed numberX
.Sample Usage
scalar value |
bases for output |
add |
index |
bases for input |
svvs(scalar value;bases for output;add;index;bases for
input) |
---|---|---|---|---|---|
19991231 | 100 | 0 | 2 | 0 100 100 | 31
|
19991231 | 100 100 | 0 | 0 1 | 0 100 100 | 199912
|
235959 | 24 60 60 | 0 | 0 1 2 | 100 100 100 | 86399 (the number of seconds in 23:59:59)
|
1234 | 10 10 10 10 | 5 | 3 2 1 0 | 10 10 10 10 | 9876
|
Example
This example demonstrates how svvs(X;Y;Z;I;B)
can parse a
YYYYMMDD
date into month, day, and year.
<base table="pub.demo.retail.item"/> <willbe name="month" value="svvs(date;100;0;1;0 100 100)"/> <willbe name="day" value="svvs(date;100;0;2;0 100 100)"/> <willbe name="year" value="svvs(date;100;0;0;0 100 100)" format="type:nocommas"/> <colord cols="date,month,day,year"/>