Home » Developer & Programmer » Reports & Discoverer » please need help with calculations (disc 10.1.2)
please need help with calculations Tue, 06 October 2009 11:24
 aarti81 Messages: 235Registered: December 2007 Location: USA Senior Member
Hi All,

I have a field "Hours" and its has values from 1-24, it gives the hour in which an incident happened. The user wants to enter any value between 1-24 in the parameter and see the incidents for that period. For example if he/she enters the value "06-09" then they must see all the incidents between 6am and 9am.
Secondly i have a field "RTDIRNTYMEAS" with the following set of values :

94 w m 35.0
80 w m 7.7
65 s m 33.2
465 e r 22.2

From these records i have to extract the direction "e,w,n,s" and i used the following calculation :

ltrim(substr(t1.RTDIRNTYMEAS,4,2))
but when i used the above calculation as a page item i'm getting additional value for each, for example in the page item drop down i'm getting e,e,w,w,n,n,s,s,all. How can i get just one of each? please need help or advice.

Thanks
Re: please need help with calculations [message #424953 is a reply to message #424941] Tue, 06 October 2009 12:04
 cookiemonster Messages: 13894Registered: September 2008 Location: Rainy Manchester Senior Member
aarti81 wrote on Tue, 06 October 2009 17:24
Hi All,

I have a field "Hours" and its has values from 1-24, it gives the hour in which an incident happened. The user wants to enter any value between 1-24 in the parameter and see the incidents for that period. For example if he/she enters the value "06-09" then they must see all the incidents between 6am and 9am.

Well if you use two parameters for this - from_hour and to_hour - a simple between should do the job.

aarti81 wrote on Tue, 06 October 2009 17:24

Secondly i have a field "RTDIRNTYMEAS" with the following set of values :

94 w m 35.0
80 w m 7.7
65 s m 33.2
465 e r 22.2

From these records i have to extract the direction "e,w,n,s" and i used the following calculation :

ltrim(substr(t1.RTDIRNTYMEAS,4,2))
but when i used the above calculation as a page item i'm getting additional value for each, for example in the page item drop down i'm getting e,e,w,w,n,n,s,s,all. How can i get just one of each? please need help or advice.

Thanks

Use distinct possibly? It's hard to tell becuase with the limited example you've given you should only get one of each. And where did the all come from?

I do think you're going to regret storing all that data in 1 column mind, makes it very hard to validate, query properly, do anything usefull with. Looks like you need four columns.
Re: please need help with calculations [message #429954 is a reply to message #424953] Fri, 06 November 2009 08:28
 aarti81 Messages: 235Registered: December 2007 Location: USA Senior Member