on 03-21-2016 12:20 PM
Hello everyone,
another (simple?) question : let's say we have following node structure :
/compoundemployee/person/employment_information
custom_string1
end_date
start_date
user_id
...
job_information
company
location
...
We wish to sort the node employment information by start_date. Can this be achieved somehow via graphical mapping (sort / sortbykey) ? I only see as a rule for comparing values 'case insensitive', 'case sensitive', 'float number', but no date.
I'm working on a a Groovy script to achieve this, but if it's can somehow be done standard ?
Thanks !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Kevin,
I believe this is not possible using SortbyKey function.
You need to have a UDF/Groovy script.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raghuraman,
I solved this in HCI by using a mapping step -> New XSL Mapping.
The XSL file needs to be in the \src\main\resources\mapping folder.
Example using XSL 1.0 :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output encoding="cp1252" />
<xsl:template match="queryCompoundEmployeeResponse/CompoundEmployee/person">
<xsl:copy>
<xsl:apply-templates select="employment_information">
<!-- concat year, month, day -->
<xsl:sort select="concat(
substring(start_date, 1, 4),
substring(start_date, 6, 2),
substring(start_date, 9, 2)
)"/>
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
User | Count |
---|---|
85 | |
10 | |
9 | |
9 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.