Skip to Main Content

Analytics Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Grand Total on LAST() Aggregation Based on Date Dimension

orawin2Jul 6 2015 — edited Jul 7 2015

The Grand Total is not calculating correct on Amount metric that is set to LAST() aggregation Based on Date dimension.

When the report is run with Quarter in the criteria, the Grand Total is being calculated for the data available in the LAST month. Instead I'd assume it should calculate the Grand Total on all LAST() data available in the Quarter.

Following are the details.

Version: 11.1.1.7.140527 (Build 140515.1014 64-bit)

Raw data:

Grain of the underlying fact table is Amounts per month per item. The following data does not have amount for item 838 in Month 2015 / 03.

Image1.png

Requirement:

The Requirement is to always show LAST() value for the Amount metric. The Grand Total should show the Sum of Last values.

Build:

Image2.png

Image3.png

Result Analysis

Image4.png

Shouldn't the Total for Quarter be 9,546?

Issue investigation:

BI is showing 6,502 as the Total for the Quarter.It is taking the data from last month, summing that data and displaying as the Total for the Quarter. You can see 6,502 being the total for 2015 / 03 in the following screenshot:

Image5.png

Is this expected behavior? I was hoping that it takes the last available data of each Item in the entire Quarter, sum it and display as the Total for the Quarter. That would be item 403 and 404 from 2015 / 03 and 838 from 2015 / 02 = 3,202 + 3,300 + 3,044 = 9,546.

Any thoughts?

Thank you for your time!

Message was edited by: nk k

Added more description to explain the intended behavior. Message was edited by: nk k

Comments

675595
Can you please try printing $inbound and see if the fields are properly populated.
If so then it might be some issue with XPath.
$inbound/ctx:transport/ctx:request/tp:headers/email:Subject/text()
$inbound/ctx:transport/ctx:request/tp:headers/email:Subject/*

Manoj
605614
Hi,
Thanks! Your suggestion gave me clues on what to do.

I "*Assign*"

concat('<?xml version="1.0"?>
<OracleSBMessage>
<MessageType>ApplicationEmailNotification</MessageType>
<MessageChannel>Email</MessageChannel>
<MessageSecurity>NONSSL</MessageSecurity>
<Email>
<Date>', $inbound/ctx:transport/ctx:request/tp:headers/email:Date/text(), '</Date>
<Subject>', $inbound/ctx:transport/ctx:request/tp:headers/email:Subject/text(), '</Subject>
<Importance>Normal</Importance>
<From>', $inbound/ctx:transport/ctx:request/tp:headers/email:From/text(), '</From>
<To>', $inbound/ctx:transport/ctx:request/tp:headers/email:To/text(), '</To>
<Cc>', $inbound/ctx:transport/ctx:request/tp:headers/email:Cc/text(), '</Cc>
<Body>', $body/text(), '</Body>
</Email>
</OracleSBMessage>')

"*to variable*" inboundXMLEmail

and then "*Log*" _$inboundXMLEmail_

the log file succesfully shows the current XML String as customized above.


I then created a "*Route*" which "*Route To*" a Business Service which implements a JMS endpoint address to send the message to Weblogic JMS Queue.

Upon checking the Weblogic JMS Queue, JMS Messages indeed went in. However, upon viewing the JMS Messages, the XML String created was not the body of the JMS Message, but instead the actual Microsoft Outlook HTML Format of the E-mail.

So I went back to the "*Route*", and inside the "*Request Actions*", I then "*Assign*"
<xmlns:Body>
{$inboundXMLEmail/OracleSBMessage/text()}
</xmlns:Body>

"*to variable*" body

using a user defined namespace of xmlns http://schemas.xmlsoap.org/soap/envelope/

However, upon running it, I received the following error:

####<Sep 7, 2009 11:10:06 AM SGT> <Error> <WliSbTransports> <EMCPC272> <ALSBAdminServer> <[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <BEA1-00101B49A2EC1FDC02BF> <> <1252293006324> <BEA-381014> <Error occured for endpoint ProxyService TestProject/ProxyServices/EmailProxyService
com.bea.wli.sb.transports.TransportException: ALSB Assign action failed updating variable "body": com.bea.wli.common.xquery.XQueryException: Error parsing XML: {err}XP0006: "<?xml version="1.0"?>
<OracleSBMessage>
<MessageType>EmailNotification</MessageType>
<MessageChannel>Email</MessageChannel>
<MessageSecurity>NONSSL</MessageSecurity>
<Email>
<Date>Mon Sep 07 11:10:03 SGT 2009</Date>
<Subject>TestSubject</Subject>
<Importance>Normal</Importance>
<From>Henry Wu <henry@company.com></From>
<To>Henry Wu <henry@company.com></To>
<Cc></Cc>
<Body>TestBody</Body>
</Email>
</OracleSBMessage> ({http://www.w3.org/2001/XMLSchema}string)": bad value for type node
at com.bea.wli.sb.transports.TransportException.newInstance(TransportException.java:146)
at com.bea.wli.sb.transports.TransportManagerImpl.receiveMessage(TransportManagerImpl.java:276)
at com.bea.wli.sb.transports.email.EmailPublishedTask.process(EmailPublishedTask.java:118)
at com.bea.wli.sb.transports.poller.listener.PolledMessageListenerMDB.onMessage(PolledMessageListenerMDB.java:42)
at weblogic.ejb.container.internal.MDListener.execute(MDListener.java:429)
at weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:335)
at weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:291)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4060)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:3953)
at weblogic.jms.client.JMSSession$UseForRunnable.run(JMSSession.java:4467)
at weblogic.work.ServerWorkManagerImpl$WorkAdapterImpl.run(ServerWorkManagerImpl.java:518)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)

Hope you can help in why replacing the contents of the variable $body would not work in this conditions.

Many Thanks,
Henry
605614
Hi,
Thanks. I solved this by not changing $body, but instead have the formed XML String inserted into the a user-defined property in the transport header, then essentially the JMS Message's user-defined properties will have this XML String.

Regards,
Henry
1 - 3
Locked Post
New comments cannot be posted to this locked post.