Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Designing Analytics Reports
Date Adds
Migrateduser
I have a query that runs and pulls a comprehensive look at a massive group of rows. It is currently pulling 4300 rows, and that number grows each quarter.<br />
<br />
The report is not designed to show all 4300 rows, but rather a breakdown of the data. My question is 2 parts:<br />
<br />
<strong class='bbc'>1. How do I add dates together?</strong><br />
<p class='bbc_indent' style='margin-left: 40px;'><br />
I have 2 code snippets that work great:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>Total.ave(dataSetRow["origdate"],
BirtComp.lessThan(dataSetRow["reportdate"],"2012-04-01")
*BirtComp.equalTo(dataSetRow["docstyle"],"NPR")
*BirtComp.greaterOrEqual(dataSetRow["reportdate"],"2012-01-01")
*BirtComp.equalTo(dataSetRow["orig"],"ORIG"))
Total.ave(dataSetRow["compdate"],
BirtComp.lessThan(dataSetRow["reportdate"],"2012-04-01")
*BirtComp.equalTo(dataSetRow["docstyle"],"NPR")
*BirtComp.greaterOrEqual(dataSetRow["reportdate"],"2012-01-01")
*BirtComp.equalTo(dataSetRow["comp"],"COMP"))
</pre>
The idea is to grab an average date within a range based on certain criteria. This code actually works. Separately. My question is this: If the first returns <em class='bbc'>2/1/2012</em>, and the second returns <em class='bbc'>2/15/12</em> - how can I subtract one from the other and get "14 days"...all in the same data field?<br /></p>
<strong class='bbc'>2. Is there a better place to put my code than where I am putting it? (optimization)</strong><br />
<p class='bbc_indent' style='margin-left: 40px;'><br />
In my report, I have added different <em class='bbc'>data expressions</em> from the Palette. There are something like 40 of these and inside them, the expressions have various versions of the code above. It makes the report run heavy. The query takes 2-4 seconds to run, but the calculations take quite a while.<br />
<br />
Is there a better place to put this code than where I am currently doing it?<br /></p>
<br />
I hope that makes sense, thanks for your time.<br />
<br />
-Shadraq
Find more posts tagged with
Comments
There are no comments yet