Wiki source code of SetMetric
Version 2.1 by Outhman Moustaghfir on 2024/01/25 12:20
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | === Description === | ||
2 | |||
3 | The SetMetric function is used to set a metric in XSLT. It allows you to specify the name of the metric, its alias (projection), and the desired value. | ||
4 | |||
5 | === Syntax === | ||
6 | |||
7 | {{{ | ||
8 | }}} | ||
9 | |||
10 | {{code language="XML"}} | ||
11 | <xsl:value-of select="ixf:SetMetric(metricName, projection, value)"></xsl:value-of> | ||
12 | |||
13 | {{/code}} | ||
14 | |||
15 | === Parameters === | ||
16 | |||
17 | * **metricName**: The name of the metric to be set. (Required) | ||
18 | * **projection**: The alias of the metric. (Required) | ||
19 | * **value**: The value to be assigned to the metric. (Required) | ||
20 | |||
21 | === Example === | ||
22 | |||
23 | Consider the following example where the metric "TotalSales" with an alias "SalesAlias" is set to the value 500: | ||
24 | |||
25 | {{{ | ||
26 | }}} | ||
27 | |||
28 | {{code language="XML"}} | ||
29 | <xsl:value-of select="ixf:SetMetric('TotalSales', 'SalesAlias', '500')"></xsl:value-of> | ||
30 | |||
31 | {{/code}} | ||
32 | |||
33 | This will set the metric named "TotalSales" with the alias "SalesAlias" to the value 500. | ||
34 | |||
35 | === Notes === | ||
36 | |||
37 | * All parameters (metricName, projection, and value) are required. | ||
38 | |||
39 | === === |