28.01.2013 Views

SAP HANA Developer Guide - Get a Free Blog

SAP HANA Developer Guide - Get a Free Blog

SAP HANA Developer Guide - Get a Free Blog

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Function Syntax Purpose<br />

UTF-8 bytes and has no knowledge of<br />

unicode characters (neither for the<br />

whitespace string nor for length<br />

computation).<br />

replace string replace(string, string, string) replace every occurrence of arg2 in arg1<br />

with arg3 and return the resulting string<br />

Mathematical Functions<br />

Function Syntax Purpose Example<br />

sign int sign(double)<br />

int sign(time)<br />

int sign(date)<br />

abs double abs(double)<br />

round<br />

.<br />

rounddown<br />

Date Functions<br />

decfloat abs(decfloat)<br />

decfloat abs(decfloat)<br />

time abs(time)<br />

Sign returns -1, 0 or 1<br />

depending on the sign of its<br />

argument. Sign is<br />

implemented for all numeric<br />

types, date and time.<br />

Abs returns arg, if arg is<br />

positive or zero, -arg else.<br />

Abs is implemented for all<br />

numeric types and time.<br />

double round(double, int) round does rounding of<br />

absolute values toward zer<br />

while the sign is retained<br />

double rounddown(double,<br />

int)<br />

rounddown rounds toward<br />

negative infinity making<br />

rounddown(-1.1, 0) = -2<br />

Function Syntax Purpose<br />

round(123.456, 0) = 123<br />

round(123.456, 1) = 123.5<br />

round(-123.456, 1) = -123.5<br />

round(123.456, -1) = 120<br />

rounddown(123.456, -1) =<br />

120<br />

rounddown(-123.456, -1) =<br />

-130<br />

utctolocal utctolocal(datearg, timezonearg) interprets datearg (a date, without<br />

timezone) as utc and convert it to the<br />

timezone named by timezonearg (a<br />

string)<br />

localtoutc localtoutc(datearg, timezonearg) converts the local datetime datearg to<br />

the timezone specified by the string<br />

timezonearg, return as a date<br />

weekday weekday(date) returns the weekday as an integer in the<br />

range 0..6, 0 is monday.<br />

now now() returns the current date and time<br />

(localtime of the server timezone) as<br />

date<br />

150<br />

P U B L I C<br />

© 2012 <strong>SAP</strong> AG. All rights reserved.<br />

<strong>SAP</strong> <strong>HANA</strong> <strong>Developer</strong> <strong>Guide</strong><br />

Setting Up the Analytic Model

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!