xml - Determine year quarter from specific date XSL -
i need function determine year quarter date belongs to. found excel function , tried apply same logic in xsl not work
<xsl:function name="bi:quarter"> <xsl:param name="value"/> <xsl:variable name="quarter"><xsl:value-of select="round((((month-from-date($value)-1) mod 3)+1))"/></xsl:variable> <xsl:value-of select="$quarter"/> </xsl:function> thanks!
if, seems, using xslt 2.0, can calculate quarter of date using:
<xsl:value-of select="ceiling(month-from-date($your-date) div 3)" /> note: $your-date must instance of xs:date.
Comments
Post a Comment