Changes for page InitMetrics
Last modified by Outhman Moustaghfir on 2024/02/26 17:12
<
>
edited by Outhman Moustaghfir
on 2024/02/01 17:26
on 2024/02/01 17:26
edited by Outhman Moustaghfir
on 2024/02/01 17:22
on 2024/02/01 17:22
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -6,7 +6,7 @@ 6 6 7 7 The **InitMetrics **function provides functionality to initialize metrics in a flexible way. It allows for the deletion of metrics, projections, and the initialization of projections with fixed values or XPath expressions. 8 8 9 -= Usage = 9 += Usage = 10 10 11 11 {{code language="XML"}} 12 12 <xsl:value-of select="ixf:InitMetrics('Metric','Projection','Value')"></xsl:value-of> ... ... @@ -27,7 +27,7 @@ 27 27 * If projection is provided, value initializes the projection. 28 28 * If value is not provided, the specified projection is deleted. 29 29 ))) 30 -1. **defaultValue (Optional):** The default value used in case of XPath expression evaluation failure. Defaults to 0if not provided.30 +1. **defaultValue (Optional):** The default value used in case of XPath expression evaluation failure. Defaults to -1 if not provided. 31 31 32 32 === Usage Examples === 33 33 ... ... @@ -45,13 +45,11 @@ 45 45 46 46 Assuming you want to initialize a projection named 'YourProjection' in the metric 'YourMetric' with a fixed value of 42: 47 47 48 -{{code language="XML"}} 49 -<xsl:value-of select="ixf:InitMetrics('YourMetric', 'YourProjection', '42')"></xsl:value-of> 50 -{{/code}} 51 - 52 52 {{{ 53 53 }}} 54 54 51 +<xsl:value-of select="ixf:InitMetrics('YourMetric', 'YourProjection', '42')"/> 52 + 55 55 This example initializes the 'YourProjection' projection in the 'YourMetric' metric with the fixed value of 42. 56 56 57 57 **Example using XPath Expression:** ... ... @@ -58,10 +58,10 @@ 58 58 59 59 Assuming you want to initialize a projection named 'YourProjection' in the metric 'YourMetric' with an XPath expression 'Order[Company = 'HM']' and a default value of -1: 60 60 61 -{{code language="XML"}} 62 -<xsl:value-of select="ixf:InitMetrics('YourMetric', 'YourProjection', 'Order[Company = ''HM'']', -1)"></xsl:value-of> 63 -{{/code}} 59 +{{{ 60 + }}} 64 64 62 +<xsl:value-of select="ixf:InitMetrics('YourMetric', 'YourProjection', 'Order[Company = ''HM'']', -1)"/> 65 65 66 66 This example initializes the 'YourProjection' projection in the 'YourMetric' metric with the provided XPath expression. If the XPath expression fails to evaluate, it uses the default value of -1. 67 67 ))) ... ... @@ -70,11 +70,11 @@ 70 70 71 71 Assuming you want to count trackings where the 'Company' is 'HM' using an XPath expression: 72 72 73 -{{code language="XML"}} 71 +{{{ 72 + }}} 73 + 74 74 <xsl:value-of select="ixf:InitMetrics('YourMetric', 'YourProjection', 'Order[Company = ''HM'']', -1)"/> 75 -{{/code}} 76 76 77 - 78 78 This example uses an XPath expression to count trackings where the 'Company' is 'HM'. If the XPath expression fails, it uses the default value of -1. 79 79 ))) 80 80