Categories
- All Categories
- 15 Oracle Analytics Sharing Center
- 15 Oracle Analytics Lounge
- 214 Oracle Analytics News
- 42 Oracle Analytics Videos
- 15.7K Oracle Analytics Forums
- 6.1K Oracle Analytics Idea Labs
- Oracle Analytics User Groups
- 78 Oracle Analytics Trainings
- 14 Oracle Analytics Data Visualizations Challenge
- Find Partners
- For Partners
Date comparison in graph - xml publisher

Summary
Date comparison in graph - xml publisher
Content
Hi,
i need to create a line graph showing some field values against date.
i need to test if date value is greater than current month then line should stop displaying further.
e.g. A'cumulative line(red) should disappear after jun 17.
PFB, code snippet
<RowData>
<xsl:value-of select="xdoxslt:set_variable($_XDOCTX,'ac', 0)" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" />
<xsl:for-each-group select="current-group()" group-by="MON_YY" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs">
<Cell>
<xsl:variable name="dateValue" select="current-group()/ROUNDED_DATE"/>
<xsl:choose>
<xsl:when test="xs:date($dateValue) <= current-date()">
<xsl:value-of select="sum(current-group()/ACTUALS[.!='' and .!='0' and ../PROP_NAME='Actuals'])+xdoxslt:get_variable($_XDOCTX,'ac')" />
</xsl:when>
</xsl:choose>
<xsl:value-of select="xdoxslt:set_variable($_XDOCTX,'ac',sum(current-group()/ACTUALS[.!='' and .!='0' and ../PROP_NAME='Actuals'])+xdoxslt:get_variable($_XDOCTX,'ac'))" />
</Cell>
</xsl:for-each-group>
</RowData>
any solutions???????
Best Regards,
Shaikh
Answers
-
Do it in the query ... any value above your date set to NULL ....
0 -
Hi Thomas,
Thanks for responding.
i tried setting null values for future dates but we are using sum() to get cumulative value hence it gives 0 instead of Null.
any inputs????
Regards,
Zeenat
0 -
evaluate the date if less than or equal to your 'target' date do the sum else NULL ... don't sum a null
OR
sum it up for every date (and get the flat line like you have) then wrap that sql with a case when the date >= target then use the null and not the re-summed value
wrapping a SQL:
SELECT x.DATE,
CASE WHEN x.DATE >= 'DD-MON-YYYY' THEN NULL ELSE VAL END VAL
FROM (
SELECT DATE, SUM(VALUE) VAL FROM TABLE GROUP BY DATE) x
0