Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

FunctionUsageSyntaxExampleExample Result
Day DifferenceReturns the difference between <End Time> and <Start Time> in daysDDIFF(<End Time>, <Start Time>)DDIFF(Discharge Time, Admission Time)Returns the difference in days from the time of admission to hospital to the time of patient discharge.
Month DifferenceReturns the difference between <End Time> and <Start Time> in months.
Returns whole numbers.
MDIFF(<End Time>, <Start Time>)MDIFF(Arrival Time, Departure Time)Returns the difference in months from the time a ship departures from its departure port to the time of
arrival in its destination port. 
Quarter DifferenceReturns the difference between <End Time> and <Start Time> in quarters.
Returns whole numbers.
QDIFF(<End Time>, <Start Time>)QDIFF(End Semester, Start Semester)Returns the difference in quarters from the first academic semester to the graduation semester.
Year DifferenceReturns the difference between <End Time> and <Start Time> in years.
Returns whole numbers.
YDIFF(<End Time>, <Start Time>)YDIFF(Sentence End, Sentence Start)Returns the difference in years from sentence start to sentence end.
Second DifferenceReturns the difference between <End Time> and <Start Time> in seconds.SDIFF(<End Time>, <Start Time>)SDIFF(Leaving Time, Landing Time)Returns the difference in seconds from the time of landing on the page to the time of leaving the page.
Minute DifferenceReturns the difference between <End Time> and <Start Time> in minutes.MNDIFF(<End Time>, <Start Time>)MNDIFF(Payment Completed Time,
Landing Time)
Returns the difference in minutes from the time of landing on the page to the time of completing payment.
Hour DifferenceReturns the difference between <End Time> and <Start Time> in hours.
Returns whole numbers.
HDIFF(<End Time>, <Start Time>)HDIFF(Attendance Time, Check-in Time)Returns the difference in hours between the check-in time to the Emergency Room and time of attendance
by the doctor. 
Past Week DifferenceReturns the difference between this week's data and the data from the
previous week.

Use this function when the time resolution used in your widget is day or week.
DIFFPASTWEEK(<numeric field>)DIFFPASTWEEK(Total Sales)Returns the difference between this week's sales and previous week's sales, for the displayed time resolution.
For example, for day resolution: (sales in current day - sales in same day one week back).
For week resolution: (sales in current week - sales in previous week)
Past Month DifferenceReturns the difference between this month's data and the data from the
previous month.
DIFFPASTMONTH(<numeric field>)DIFFPASTMONTH(Total Sales)Returns the difference between this month's sales and previous month's sales, for the displayed time resolution.
Past Quarter DifferenceReturns the difference between this quarter's data and the data from the
previous quarter.
DIFFPASTQUARTER(<numeric field>)DIFFPASTQUARTER(Total Sales)Returns the difference between this quarter's sales and previous quarter's sales, for the displayed time resolution.
Past Year DifferenceReturns the difference between this year's data and the data from the
previous year.
DIFFPASTYEAR(<numeric field>)DIFFPASTYEAR(Total Sales)Returns the difference between this year's sales and previous year's sales, for the displayed time resolution.
Past Period DifferenceReturns the difference between this period's data and the data from the
previous period, using the current time resolution.
DIFFPASTPERIOD(<numeric field>)DIFFPASTPERIOD(Total Sales)Returns the difference between this period's sales and previous period's sales.
GrowthCalculates growth over time. (0% baseline)
Accepts any time resolution (day, week, etc.) in the widget.
GROWTH(<numeric field>)GROWTH(Total Quantity)If this month your Total Quantity is 12, and last month it was 10, your Growth for this month is 20% (0.2).
Calculation: (12 – 10) / 10 = 0.2

If this year your Total Quantity is 80, and last year it was 100, your Growth for this year is -20% ( -0.2).
Calculation: (80 – 100) / 100 = -0.2
Growth RateCalculates growth over time. (100% baseline)
Accepts any time resolution (day, week, etc.) in the widget.
GROWTHRATE(<numeric field>)GROWTHRATE(Total Quantity)If this month your Total Quantity is 12, and last month it was 10, your Growth for this month is 120% (1.2).
Calculation: 12/ 10 = 1.2

If this year your Total Quantity is 80, and last year it was 100, your Growth for this year is 80% (0.8).
Calculation: 80 / 100 = 0.8
Growth Past WeekCalculates the growth from the past week to the current week.
Use this function when the time resolution in your widget is weeks or days.
GROWTHPASTWEEK(<numeric field>)GROWTHPASTWEEK(Total Sales)Calculates the difference between this week's sales and previous week's sales, for the displayed time resolution.
Growth Past MonthCalculates the growth from the past month to the current month.
Use this function when the time resolution in your widget is month or day.
GROWTHPASTMONTH(<numeric field>)GROWTHPASTMONTH(Total Sales)Calculates the difference between this month's sales and previous month's sales, for the displayed time resolution.
Growth Past QuarterCalculates the growth from the past quarter to the current quarter.
Use this function when the time resolution in your widget is month or quarter.
GROWTHPASTQUARTER(<numeric field>)GROWTHPASTQUARTER(Total Sales)Calculates the difference between this quarter's sales and previous quarter's sales, for the displayed time resolution.
Growth Past YearCalculates the growth from the past year to the current year.GROWTHPASTYEAR(<numeric field>)GROWTHPASTYEAR(Total Sales)Calculates the difference between this year's sales and previous year's sales, for the displayed time resolution.
PrevReturns the Time period Member in <Time Field> which is N periods back
from the current member.
((<numeric field>), PREV(<Time Field>,
[<N>]))
([Total Quantity], PREV([Months in Date], 2))Returns the Total Quantity value for the month that occurred two months ago.
NextReturns the value for the time-period member in <Time Field> which is N
periods after the current member.
((<numeric field>), NEXT(<Time Field>,
[<N>]))
([Total Quantity],NEXT([Months in Date], 2))Returns the Total Quantity value for the month occurring two months ahead.
NowReturns the value for the current time period.((<numeric field>), NOW(<Time Field>))([Total Quantity],NOW([Months in Date]))This formula returns the Total Quantity value for the current month.
Past DayReturns the value for the previous day.PASTDAY(<numeric field>)PASTDAY(Total Sales)Returns the Total Sales value one day back.
Past WeekReturns the value for the same period in the previous week.PASTWEEK(<numeric field>)PASTWEEK(Total Sales)Returns the Total Sales value one week back for the displayed time resolution.
Past MonthReturns the value for the same period in the previous month.PASTMONTH(<numeric field>)PASTMONTH(Total Sales)Returns the Total Sales value one month back for the displayed time resolution.
Past QuarterReturns the value for the same period in the previous quarter.PASTQUARTER(<numeric field>)PASTQUARTER(Total Sales)Returns the Total Sales value one quarter back for the displayed time resolution.
Past YearReturns the value for the same period in the previous year. PASTYEAR(<numeric field>)PASTYEAR(Total Sales)Returns the Total Sales value one year back for the displayed time resolution.
RangeReturns an accumulated value for a data set where two members of the same
dimension and level define the minimum and maximum values of the range.
RANGE(<Start Date>, <End Date>)( [Total Quantity],
RANGE ( PREV ( [Days in Date],2),
current( [Days in Date] )))
Returns the Total Quantity value in the range between two days ago and today.
Week to Date AverageReturns the running average starting from the beginning of the week up
to the current day.
WTDAVG(<numeric field>)WTDAVG(Total Sales)Returns the running average of Total Sales starting from the beginning of the week up to the current day.
Week to Date SumReturns the running total starting from the beginning of the week up
to the current day or week.
WTDSUM(<numeric field>)WTDSUM(Total Sales)Returns the running total of Total Sales starting from the beginning of the week up to the current day.
Month to Date AverageReturns the running average starting from the beginning of the month up
to the current day.
MTDAVG(<numeric field>)MTDAVG(Total Sales)Returns the running average of Total Sales starting from the beginning of the month up to the current day.
Month to Date SumReturns the running total starting from the beginning of the month up
to the current day or week.
MTDSUM(<numeric field>)MTDSUM(Total Sales)Returns the running total of Total Sales starting from the beginning of the month up to the current day.
Quarter to Date AverageReturns the running average starting from the beginning of the quarter up
to the current day.
QTDAVG(<numeric field>)QTDAVG(Total Sales)Returns the running average of Total Sales starting from the beginning of the quarter up to the current day.
Quarter to Date SumReturns the running total starting from the beginning of the quarter up
to the current day or week.
QTDSUM(<numeric field>)QTDSUM(Total Sales)Returns the running total of Total Sales starting from the beginning of the quarter up to the current day.
Year to Date AverageReturns the running average starting from the beginning of the year up
to the current day.
YTDAVG(<numeric field>)YTDAVG(Total Sales)Returns the running average of Total Sales starting from the beginning of the year up to the current day.
Year to Date SumReturns the running total starting from the beginning of the year up
to the current day or week.
YTDSUM(<numeric field>)YTDSUM(Total Sales)Returns the running total of Total Sales starting from the beginning of the year up to the current day.

...

FunctionUsageSyntaxExampleExample Result
AllIgnores the scope set on the dimension.
This function can only work as a parameter inside another formula, and not by itself.
ALL(<numeric field>)SUM(ALL(Items))Returns the sum of all items, ignoring filters.
CaseReturns the result_expression of the first condition evaluated as true.
When no condition is true, else_expression is returned, if one is defined.
(WHEN <condition> THEN <result_expression>
[ELSE <result_expression>] END)
CASE
WHEN SUM(Sales) < 100 THEN 1
WHEN SUM(Sales) < 1000 THEN 2
ELSE 3
END
Returns '1' when Total Sales is less than 100,
Returns '2' when Total Sales is less than 1000,
Returns '3' in any other case
IfReturns numeric expression '1' when the condition is true,
and expression '2' when the condition is false.
IF (<condition>, <numeric expression 1>,
<numeric expression 2>)
IF(Count(Sales)>100,
Sum(Sales)*1.1,
sum(Sales))
If the number of unique values within the Sales values
is larger than 100, the function will return Total Sales x 1.1.
Otherwise, returns only the Total Sales
IsNullReturns true if the expression doesn't contain data (Null).ISNULL(<numeric field>)IF(ISNULL(Cost),
0, Cost)
If the Cost is null, returns 0.  Otherwise, returns the cost.
OrderingReturns the numeric order position of rows sorted into ascending or descending order, breaking ties with further arguments.
The expressions must be aggregated by applying the MIN/MAX functions.
ORDERING(<expression1>,<expression2>)ORDERING(MIN([Sales Person Name]),
MIN([Days in Transaction_Date]), Sum([Sales]))
Returns the sum of sales, ordered by sales person
descending, breaking ties with days in transaction date.

...