Categories
- All Categories
- 13 Oracle Analytics Sharing Center
- 14 Oracle Analytics Lounge
- 209 Oracle Analytics News
- 41 Oracle Analytics Videos
- 15.6K Oracle Analytics Forums
- 6.1K Oracle Analytics Idea Labs
- Oracle Analytics User Groups
- 76 Oracle Analytics Trainings
- 14 Oracle Analytics Data Visualizations Challenge
- Find Partners
- For Partners
Finding Minimum value in rtf template

Summary
Finding Minimum value in rtf template
Content
Hii,
I calculated shipment days from delivery_date and order_date in RTF template.
code is as follows
<?xdoxslt:date_diff(‘d’,
ORDER_DATE,DELIVERY_DATE,
$_XDOLOCALE, $_XDOTIMEZONE)?>
I wrote this code inside for each loop.so now i need to find minimum value from these shipment days.
How will be the code ?
Reply asap
Thank you
Answers
-
Hi
BIP has the concept of variables (check the docs) so you could create a variable x to hold an initial value of say 10000. In the loop, check the value of the calculation against the variable value and update it accordingly. At the end of the loop you would have the lowest value.
TBH thou, I think I would push all of this into the data model. Have a field in the query that calcs the difference. Then create a summary column at the report level that looks for the min value. It will perform much better in the data model and the layout template will be cleaner
Tim
0 -
Okay..Thank you..
0 -
Ahhh ... thats a slightly different question. You don't want the minimum value, you want the invoice number that has the lowest amount correct?
For that I'd use a second query to get that id, something like
select invoice_num
from invoices
where rev = (select min(rev) from invoices)
You could do it in the template but again, its going to be expensive in terms of time and processing and its better to push it to the data model.
What happens in the maybe rare case that you have two or more invoices with the same lowest value? The query above will return two rows and you can loop through them in the template to show them.
Tim
0 -
timdexter wrote: Then create a summary column at the report level that looks for the min value. It will perform much better in the data model and the layout template will be cleanerTim
Hi,
The summary column will display only one value if i run the program ?
Let's say ,I have Invoice#1234 to 2390...then if i do like above as you suggested , then i will get Invoice# 2390 correct?
Please suggest if i am thinking wrong.
0