EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics
  3. SAP HANA function support in MicroStrategy

SAP HANA function support in MicroStrategy


Norman Matos

Associate Scrum Master • Strategy


This article lists the SAP HANA functions supported in MicroStrategy.

Basic Function

MicroStrategy pushes the calculations for the following list of built-in basic functions down to SAP HANA using the associated SQL patterns.
 

Function

SQL Pattern

Add

(#0#< + #*#>)  

Average

(#0#< + #*#>) / (((0 * #0) + 1)#< + ((0 * #*) + 1)#>)  

Avg

AVG(#0#<#*#>) 

Count

COUNT(#0#<#*#>) 

GeoMeanFunction

EXP(AVG(LN(#0))) 

GreatestFunction

GREATEST(#0#<, #*#>) 

LeastFunction

LEAST(#0#<, #*#>) 

Max

MAX(#0#<#*#>) 

Min

MIN(#0#<#*#>) 

Multiply

(#0#< * #*#>)  

StdevFunction

STDDEV(#0#< #*#>) 

Sum

SUM(#0#<#*#>) 

VarFunction

VAR(#0#< #*#>) 


Microstrategy uses the Analytical Engine to implement the following Basic Functions:

  • First
  • HistogramMedian
  • Last
  • Median
  • Mode
  • Product
  • StdevP
  • VarP

String Functions

MicroStrategy pushes the calculations for the following list of built-in string functions down to SAP HANA using the associated SQL patterns.
 

Function

SQL Pattern

ConcatFunction

CONCAT(#0, #1) 

LengthFunction

LENGTH(#0)

LowerFunction

LOWER(#0) 

LTrimFunction

LTRIM(#0) 

PositionFunction

LOCATE(#1, #0) 

RTrimFunction

RTRIM(#0) 

SubStrFunction

SUBSTRING(#0, #1, #2) 

InitCapFunction

(UPPER(SUBSTRING(#0, 1, 1)) || LOWER(SUBSTRING(#0, 2, Length(#0) - 1))) 

TrimFunction

LTRIM(RTRIM(#0)) 

RightStrFunction

RIGHT(#0, #1) 

LeftStrFunction

LEFT(#0, #1) 

UpperFunction

UPPER(#0) 

ConcatBlankFunction

(#0#< || ' ' || #*#>) 


MicroStrategy uses the Analytical Engine to implement the following string functions:

  • ConcatAgg
  • StrBeginsWith
  • StrChar
  • StrEndsWith
  • StrLastPosition
  • StrMatch
  • StrRepeat
  • StrReplace
  • StrSplit
  • StrTitleCap
  • ToString

Date and Time Function

MicroStrategy pushes the calculations for the following list of built-in date and time functions down to SAP HANA using the associated SQL patterns.
 

Function

SQL Pattern

DaysBetweenFunction

DAYS_BETWEEN(#0, #1)

YearEndDateFunction

ADD_DAYS(ADD_MONTHS (#0, (13 - EXTRACT(MONTH FROM #0))),- EXTRACT(DAY FROM #0))

CurrentDateFunction

NOW()

DayOfMonthFunction

DAYOFMONTH(#0)

DayOfWeekFunction

(CASE WHEN WEEKDAY(#0) =6 THEN WEEKDAY(#0)-5 ELSE WEEKDAY(#0)+2 END)

DayOfYearFunction

DAYOFYEAR(#0)

WeekFunction

TO_CHAR(#0,'WW')

MonthFunction

MONTH(#0)

QuarterFunction

TO_CHAR (#0, 'Q')

YearFunction

YEAR(#0)

CurrentDateTimeFunction

NOW()

CurrentTimeFunction

NOW()

HourFunction

HOUR(#0)

MinuteFunction

MINUTE(#0)

SecondFunction

ROUND(SECOND(#0))

MilliSecondFunction

substring(cast(extract(second from #0) as char(10)), 4, 3)

MonthStartDateFunction

ADD_DAYS(#0,1-DAYOFMONTH(#0))

YearStartDateFunction

ADD_MONTHS (ADD_DAYS (#0, 1 - (EXTRACT(DAY FROM #0))), 1 -(EXTRACT(MONTH FROM #0)))

AddMonthsFunction

ADD_MONTHS(#0, #1)

MonthsBetweenFunction

(12 * (EXTRACT(YEAR FROM #1) - EXTRACT(YEAR FROM #0)) + EXTRACT(MONTH FROM #1) - EXTRACT(MONTH FROM #0) - (CASE WHEN EXTRACT(DAY FROM #0) > EXTRACT (DAY FROM #1) THEN 1 ELSE 0 END))

AddDaysFunction

ADD_DAYS(#0, #1)

MonthEndDateFunction

ADD_DAYS((ADD_MONTHS(#0, 1)), -DAYOFMONTH((ADD_MONTHS(#0, 1))))

DateFunction

TO_DATE(#0,'YYYY-MM-DD')

 
MicroStrategy uses the Analytical Engine to implement the following date and time functions:
  • DateDiff
  • FiscalMonth
  • FiscalQuarter
  • FiscalWeek
  • FiscalYear
  • QuarterStartDate
  • TpDateTime
  • WeekStartDate

OLAP Function

OLAP functions are a powerful family of functions for business intelligence and data warehousing applications. These functions provide significant analytical capabilities for many business analysis queries. Many of MicroStrategy’s OLAP functions are calculated via SQL in SAP HANA rather than in the MicroStrategy analytical engine. There is no VLDB setting associated with this option.

MicroStrategy pushes the calculations for the following list of built-in OLAP functions down to SAP HANA using the associated SQL patterns.
 

Function

SQL Pattern

LagFunction

lag(#0#<, #*#>) over ([#P] [#O]) 

LeadFunction

lead(#0#<, #*#>) over ([#P] [#O]) 

OLAPRankFunction

rank() over ([#P] [#O])

 
MicroStrategy uses the Analytical Engine to implement the following OLAP functions:
  • ExpWghMovingAvg
  • ExpWghRunningAvg
  • FirstInRange
  • LastinRange
  • MovignAvg
  • MovingCount
  • MovingDifference
  • MovingMax
  • MovingMin
  • MovingStdev
  • MovingStdevP
  • MovingSum
  • OLAPAvg
  • OLAPCount
  • OLAPMax
  • OLAPMin
  • OLAPSum
  • RunningAvg
  • RunningCount
  • RunningMax
  • RunningMin
  • RunningStdev
  • RunningStdevP
  • RunningSum
  • WeightedCorr
  • WeightedCov
  • WeightedMedian
  • WeightedStDev

Math Function (100.004.030)

MicroStrategy pushes the calculations for the following list of built-in math functions down to SAP HANA using the associated SQL patterns.
 

Function

SQL Pattern

Round2Function

ROUND(#0, #1)

RankFunction

#0#,#<partition by#>#<#, #*#>#|rank () over(#1#2#<, #*#> order by #0)

AbsFunction

ABS(#0)

IntersectFunction

#<(#>#1#<#0 intersect #*#>#<)#>

Int2Function

FLOOR(#0)

AcosFunction

ACOS(#0)

AcoshFunction

LN(#0+SQRT(#0-1)*SQRT(#0+1))

AsinFunction

ASIN(#0)

AtanFunction

ATAN(#0)

Atan2Function

ATAN2(#1, #0)

AtanhFunction

((LN(1+#0)-LN(1- #0))/2)

CeilingFunction

CEILING(#0)

CosFunction

COS(#0)

CoshFunction

COSH(#0)

ExpFunction

EXP(#0)

FloorFunction

FLOOR(#0)

IntFunction

FLOOR(#0)

LnFunction

LN(#0)

LogFunction

LOG(#1, #0)

Log10Function

LOG(10,#0)

PowerFunction

POWER(#0, #1)

QuotientFunction
 

(CASE WHEN SIGN(#0/NULLIF(#1, 0)) =1 THEN FLOOR (#0/NULLIF(#1,0)) ELSE CEILING (#0/NULLIF(#1,0)) END)

RoundFunction

ROUND(#0, 0)

SinFunction

SIN(#0)

SinhFunction

SINH(#0)

SqrtFunction

SQRT(#0)

TanFunction

TAN(#0)

TanhFunction

TANH(#0)

TruncFunction

CAST(#0 AS INTEGER)

AsinhFunction

LN(#0+SQRT(POWER(#0,2)+1))

ModFunction

MOD(#0, #1)


MicroStrategy uses the Analytical Engine to implement the following math functions:

  • Combine
  • Degrees
  • Factorial
  • Radians
  • Randbetween  

Financial Function (100.004.031)

Currently no financial functions in SAP HANA are supported by MicroStrategy.

Statistical Function (100.004.032)

All 12 statistical functions can be executed by the MicroStrategy Analytics Engine:

  • Correlation
  • Covariance
  • Fisher
  • Intercept
  • InverseFisher
  • Kurosis
  • Pearson
  • Rsquare
  • Skew
  • Slope
  • Standardize
  • SteYX

Predictive Functions

Currently no predictive functions in SAP HANA are supported by MicroStrategy.

Spatial Function

MicroStrategy does not provide spatial functions; however, you can use the workaround in KB483483 to use spatial functions supported by SAP HANA.


Comment

0 comments

Details

Knowledge Article

Published:

December 23, 2019

Last Updated:

January 31, 2024