[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

RE: [sqr-users] Rounding to the next whole number




I stand by my previous post.

The Ceiling function returns the smallest integer that is greater than or
equal to the value, thus

Let #result = Ceil(#value / 10)

For #value = 100              => #result = 10
For #value > 100 and <= 110   => #result = 11
For #value > 110 and <= 120   => #result = 12
etc

This is the most straight forward solution.
Roger



|---------+---------------------------------------------------->
|         |           "Kaithi, Murali"                         |
|         |           <Murali.Kaithi@spencergifts.com>         |
|         |           Sent by:                                 |
|         |           sqr-users-bounces+roger.harris=certegy.co|
|         |           m@sqrug.org                              |
|         |                                                    |
|         |                                                    |
|         |           01/05/2006 02:35 PM                      |
|         |           Please respond to "This list is for      |
|         |           discussion about the SQR database        |
|         |           reporting  language from Hyperion        |
|         |           Solutions."                              |
|         |                                                    |
|---------+---------------------------------------------------->
  
>----------------------------------------------------------------------------------------------|
  |                                                                             
                 |
  |        To:      "This list is for discussion about the SQR database 
reportinglanguage from   |
  |        Hyperion Solutions." <sqr-users@sqrug.org>                           
                 |
  |        cc:                                                                  
                 |
  |        Subject: RE: [sqr-users] Rounding to the next whole number           
                 |
  
>----------------------------------------------------------------------------------------------|



John,
Thanks for the reply,
Your second example is what I want but wouldn't it give me 36 if the
#OLD_NUMBER is 36.4156 but I still want 37.

Thanks,
Murali

-----Original Message-----
From: sqr-users-bounces+murali.kaithi=spencergifts.com@sqrug.org
[mailto:sqr-users-bounces+murali.kaithi=spencergifts.com@sqrug.org] On
Behalf Of JOHN_HARRIS@qvc.com
Sent: Thursday, January 05, 2006 2:21 PM
To: This list is for discussion about the SQR database reporting
languagefrom Hyperion Solutions.
Subject: Re: [sqr-users] Rounding to the next whole number

You can use the ROUND function.  This will return a rounded value,
rounded to x decimals of precision.

Example:    LET #OLD_NUMBER = 36.5156
            LET #NEW_NUMBER = ROUND(#OLD_NUMBER,2)
Post execution value:   36.5200

Example:    LET #OLD_NUMBER = 36.5156
            LET #NEW_NUMBER = ROUND(#OLD_NUMBER,0)
Post execution value:   37.0000




 Thank you.

 Regards,

 John



 (Embedded image moved    John Harris
 to file:                 Programmer/Analyst
 pic28703.jpg)            Application Development - Internal






QVC Inc., 1200 Wilson Drive, MC 220, West Chester, PA 19380-4262


Telephone 484-701-3303
Fax 484-701-8689
e-mail jharris@qvc.com



This message may contain information that is privileged or confidential.
This message may contain information that is privileged or confidential.
If you are not the intended recipient, you are hereby notified that any
disclosure, copying, distribution, or use of the information contained
herein is STRICTLY PROHIBITED. If you received this transmission in
error, please immediately contact the sender and destroy the material in
its entirety, whether in electronic or hard copy format.


|---------+----------------------------------------------->
|         |           "Kaithi, Murali"                    |
|         |           <Murali.Kaithi@spencergifts.com>    |
|         |           Ext:                                |
|         |           Sent by:                            |
|         |           sqr-users-bounces+john_harris=qvc.co|
|         |           m@sqrug.org                         |
|         |                                               |
|         |                                               |
|         |           01/05/2006 01:37 PM                 |
|         |           Please respond to "This list is for |
|         |           discussion about the SQR database   |
|         |           reporting       language from       |
|         |           Hyperion Solutions."                |
|         |                                               |
|---------+----------------------------------------------->

>-----------------------------------------------------------------------
-------------------------------------------------------|
  |
|
  |       To:       "This list is for discussion about the SQR database
reporting languagefrom    Hyperion Solutions."           |
  |        <sqr-users@sqrug.org>
|
  |       cc:       (bcc: JOHN HARRIS/QVC)
|
  |       Subject:  [sqr-users] Rounding to the next whole number
|

>-----------------------------------------------------------------------
-------------------------------------------------------|




I have to divide a number by 10 and if the resulting number is not a
whole number, I have to Round up to the next whole number.
How can I accomplish this?
Appreciate your response.

Thanks,
Murali


________________________________________________________________________
This Email has been scanned for all viruses by PAETEC Email Scanning
Services, utilizing MessageLabs proprietary SkyScan infrastructure. For
more information on a proactive anti-virus service working around the
clock, around the globe, visit http://www.paetec.com.
________________________________________________________________________

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users


________________________________________________________________________
This Email has been scanned for all viruses by PAETEC Email Scanning
Services, utilizing MessageLabs proprietary SkyScan infrastructure. For
more information on a proactive anti-virus service working around the
clock, around the globe, visit http://www.paetec.com.
________________________________________________________________________

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users








------------------------------------------------------------------------------
This message contains information from Certegy, Inc which may be confidential 
and privileged.  If you are not an intended recipient, please refrain from any 
disclosure, copying, distribution or use of this information and note that such 
actions are prohibited.  If you have received this transmission in error, 
please notify by e:mail postmaster@certegy.com.
==============================================================================


_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users