MicroStrategy | Calculated in Amazon Redshift | Total |
Basic | 11 | 21 |
Data Mining | 0 | 30 |
Date and Time | 23 | 31 |
Financial | 0 | 50 |
Mathematical | 33 | 34 |
OLAP | 20 | 39 |
Other | 4 | 16 |
Pattern | 0 | 3 |
Statistical | 8 | 51 |
String | 13 | 25 |
Total | 112 | 300 |
Function | SQL Pattern |
UnionFunction | #<(#>#1#<#0 union #*#>#<)#> |
ExceptFunction | #<(#>#1#<#0 except #*#>#<)#> |
StdevPFunction | STDDEV_POP(#0#< #*#>) |
LikeOperator | #0 LIKE '#1' |
ProductFunction | (CASE WHEN SUM(CASE WHEN #0=0 THEN 1 ELSE 0 END) > 0 THEN 0 ELSE POW(-1,SUM(CASE WHEN #0<0 THEN 1 ELSE 0 END))*EXP((SUM(LN(ABS(CASE WHEN #0<>0 THEN #0::float8 ELSE NULL END))))) END) |
StdevFunction | STDDEV_SAMP(#0#< #*#>) |
VarFunction | VAR_SAMP(#0#< #*#>) |
GeoMeanFunction | EXP(AVG(LN(#0))) |
NotLikeOperator | #0 NOT LIKE '#1' |
IFOperator | (CASE WHEN #0 THEN #1 ELSE #2 END) |
VarPFunction | VAR_POP(#0#< #*#>) |
Function | SQL Pattern |
DaysBetweenFunction | DATEDIFF(DAY, #0, #1) |
YearEndDateFunction | ADD_MONTHS(TRUNC(#0) - EXTRACT(DAY FROM #0), 13 - EXTRACT(MONTH FROM #0)) |
CurrentDateFunction | CURRENT_DATE |
DayOfMonthFunction | EXTRACT(DAY FROM #0) |
DayOfWeekFunction | (DATE_PART('dow',#0)+1) |
DayOfYearFunction | DATE_PART('doy',#0) |
WeekFunction | DATE_PART('week',#0) |
MonthFunction | EXTRACT(MONTH FROM #0) |
QuarterFunction | EXTRACT(QUARTER FROM #0) |
YearFunction | EXTRACT(YEAR FROM #0) |
CurrentDateTimeFunction | SYSDATE |
CurrentTimeFunction | SYSDATE |
HourFunction | EXTRACT(HOUR FROM #0) |
MinuteFunction | EXTRACT(MINUTE FROM #0) |
SecondFunction | EXTRACT(SECOND FROM #0) |
MilliSecondFunction | EXTRACT(MILLISECOND FROM #0) |
MonthStartDateFunction | dateadd(day, -1*(extract(day from #0) -1),#0) |
YearStartDateFunction | ADD_MONTHS(TRUNC(#0) - EXTRACT(DAY FROM #0) + 1, 1 - EXTRACT(MONTH FROM #0)) |
AddMonthsFunction | ADD_MONTHS(#0, #1) |
MonthsBetweenFunction | FLOOR(MONTHS_BETWEEN(#1,#0)) |
MonthEndDateFunction | dateadd(day, -1*extract(day from add_months(#0, 1)), add_months(#0, 1)) |
DateFunction | CAST(#0 AS DATE) |
Function | SQL Pattern |
RunningSumFunction | sum(#0) over(#1) |
RunningAvgFunction | avg(#0) over(#1) |
MovingAvgFunction | avg(#0) over(#1) |
MovingSumFunction | sum(#0) over(#1) |
MovingMaxFunction | max(#0) over(#1) |
MovingMinFunction | min(#0) over(#1) |
MovingCountFunction | count(#0) over(#1) |
RunningMaxFunction | max(#0) over(#1) |
RunningMinFunction | min(#0) over(#1) |
RunningCountFunction | count(#0) over(#1) |
FirstInRangeFunction | first_value(#0) over(#1) |
LastInRangeFunction | last_value(#0) over(#1) |
OLAPSumFunction | sum(#0) over ([#P] [#O] [#W]) |
OLAPAvgFunction | avg(#0) over ([#P] [#O] [#W]) |
OLAPCountFunction | count(#0) over ([#P] [#O] [#W]) |
OLAPMaxFunction | max(#0) over ([#P] [#O] [#W]) |
OLAPMinFunction | min(#0) over ([#P] [#O] [#W]) |
LagFunction | CASE WHEN count(*) OVER ([#P] [#O] rows between unbounded preceding and current row) <= #1 THEN #2 ELSE max(#0#< #*#>) OVER ([#P] [#O] rows between #1 preceding and #1 preceding) END |
LeadFunction | CASE WHEN count(*) OVER ([#P] [#O] rows between current row and unbounded following) <= #1 THEN #2 ELSE max(#0#< #*#>) OVER ([#P] [#O] rows between #1 following and #1 following) END |
OLAPRankFunction | rank() over ([#P] [#O]) |
SQL Syntax for Ordered Analytic Functions: |
|
Function | SQL Pattern |
Round2Function | ROUND(#0, CAST(#1 AS INTEGER)) |
RankFunction | #0#,#<partition by#>#<#, #*#>#|rank () over(#1#2#<, #*#> order by #0) |
AbsFunction | ABS(#0) |
IntersectFunction | #<(#>#1#<#0 intersect #*#>#<)#> |
AcosFunction | ACOS(#0) |
AcoshFunction | LN(#0+SQRT(#0-1)*SQRT(#0+1)) |
AsinFunction | ASIN(#0) |
AtanFunction | ATAN(#0) |
Atan2Function | ATAN2(#0, #1) |
AtanhFunction | ((LN(1+#0)-LN(1- #0))/2) |
CeilingFunction | CEIL(#0) |
CosFunction | COS(#0) |
CoshFunction | ((EXP(#0::float8)+EXP((#0*(-1))::float8))/2) |
DegreesFunction | DEGREES(#0) |
ExpFunction | EXP(#0::float8) |
FloorFunction | FLOOR(#0) |
IntFunction | FLOOR(#0) |
LnFunction | LN(#0) |
LogFunction | LOG(#0)/LOG(#1) |
Log10Function | LOG(#0) |
PowerFunction | POW(#0, #1) |
QuotientFunction | TRUNC((#0)/NULLIF(#1, 0)) |
RadiansFunction | RADIANS(#0) |
RandbetweenFunction | ((#1- #0)*RANDOM()+#0) |
RoundFunction | ROUND(#0) |
SinFunction | SIN(#0) |
SinhFunction | ((EXP(#0::float8) - EXP((#0*(-1))::float8))/2) |
SqrtFunction | SQRT(#0) |
TanFunction | TAN(#0) |
TanhFunction | ((EXP(#0::float8)-EXP((#0*(-1))::float8))/(EXP(#0::float8)+EXP((#0*(-1))::float8))) |
TruncFunction | TRUNC(#0) |
AsinhFunction | LN(#0+SQRT(POWER(#0,2)+1)) |
ModFunction | (#0-FLOOR((#0)/NULLIF(#1, 0))*(#1)) |
Function | SQL Pattern |
KurtosisFunction | ((((SUM(#0- #0+1)*(SUM(#0- #0+1)+1))/((SUM(#0- #0+1)-1)*(SUM(#0- #0+1)-2)*(SUM(#0- #0+1)-3)))*((SUM(POW(#0,4)))-(4*SUM(POW(#0,3))*AVG(#0))+(6*SUM(POW(#0,2))*POW(AVG(#0),2))-(4*SUM(#0)*POW(AVG(#0),3))+ |
FisherFunction | (LN((1+#0)/(1- #0))/2) |
InverseFisherFunction | ((EXP((2*#0)-1)::float8)/(EXP((2*#0)::float8)+1)) |
StandardizeFunction | case when (#2 > 0) then (#0 - #1)/(#2) else NULL end |
CovarianceFunction | ((1/SUM(#0- #0+#1- #1+1))*(SUM(#0*#1)-(AVG(#0)*SUM(#1))-(SUM(#0)*AVG(#1))+(AVG(#0)*AVG(#1)*SUM(#0- #0+#1- #1+1)))) |
RSquareFunction | POW((((SUM(#0- #0+#1- #1+1)*SUM(#0*#1))-(SUM(#0)*SUM(#1)))/SQRT(((SUM(#0- #0+#1- #1+1)*SUM(#0*#0))-(SUM(#0)*SUM(#0)))*((SUM(#0- #0+#1- #1+1)*SUM(#1*#1))-(SUM(#1)*SUM(#1))))),2) |
SlopeFunction | (((SUM(#1- #1+#0- #0+1)*SUM(#1*#0))-(SUM(#1)*SUM(#0)))/((SUM(#1- #1+#0- #0+1)*SUM(#1*#1))-(SUM(#1)*SUM(#1)))) |
InterceptFunction | (AVG(#0)-((((SUM(#1- #1+#0- #0+1)*SUM(#1*#0))-(SUM(#1)*SUM(#0)))/((SUM(#1- #1+#0- #0+1)*SUM(#1*#1))-(SUM(#1)*SUM(#1))))*AVG(#1))) |
Function | SQL Pattern |
ConcatFunction | (#0#< || #*#>) |
LengthFunction | LENGTH(#0) |
LowerFunction | LOWER(#0) |
LTrimFunction | LTRIM(#0) |
PositionFunction | POSITION(#0 IN #1) |
RTrimFunction | RTRIM(#0) |
SubStrFunction | SUBSTRING(#0, #1, #2) |
InitCapFunction | INITCAP(#0) |
TrimFunction | TRIM(BOTH ' ' FROM #0) |
RightStrFunction | SUBSTRING(#0, (LENGTH(#0) - #1) + 1) |
LeftStrFunction | SUBSTRING(#0, 1, #1) |
UpperFunction | UPPER(#0) |
ConcatBlankFunction | (#0#< || ' ' || #*#>) |