@sisense/sdk-data 1.10.1 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/dist/cjs/dimensional-model/analytics/factory.d.ts +47 -0
  2. package/dist/cjs/dimensional-model/analytics/factory.js +151 -0
  3. package/dist/cjs/dimensional-model/analytics/factory.test.d.ts +1 -0
  4. package/dist/cjs/dimensional-model/analytics/factory.test.js +99 -0
  5. package/dist/cjs/dimensional-model/attributes.d.ts +139 -0
  6. package/dist/cjs/dimensional-model/attributes.js +342 -0
  7. package/dist/cjs/dimensional-model/attributes.test.d.ts +1 -0
  8. package/dist/cjs/dimensional-model/attributes.test.js +154 -0
  9. package/dist/cjs/dimensional-model/base.d.ts +43 -0
  10. package/dist/cjs/dimensional-model/base.js +58 -0
  11. package/dist/cjs/dimensional-model/base.test.d.ts +1 -0
  12. package/dist/cjs/dimensional-model/base.test.js +17 -0
  13. package/dist/cjs/dimensional-model/data-model.d.ts +13 -0
  14. package/dist/cjs/dimensional-model/data-model.js +37 -0
  15. package/dist/cjs/dimensional-model/dimensions.d.ts +167 -0
  16. package/dist/cjs/dimensional-model/dimensions.js +307 -0
  17. package/dist/cjs/dimensional-model/dimensions.test.d.ts +1 -0
  18. package/dist/cjs/dimensional-model/dimensions.test.js +54 -0
  19. package/dist/cjs/dimensional-model/factory.d.ts +17 -0
  20. package/dist/cjs/dimensional-model/factory.js +54 -0
  21. package/dist/cjs/dimensional-model/filters/factory.d.ts +796 -0
  22. package/dist/cjs/dimensional-model/filters/factory.js +962 -0
  23. package/dist/cjs/dimensional-model/filters/factory.test.d.ts +1 -0
  24. package/dist/cjs/dimensional-model/filters/factory.test.js +366 -0
  25. package/dist/cjs/dimensional-model/filters/filters.d.ts +321 -0
  26. package/dist/cjs/dimensional-model/filters/filters.js +614 -0
  27. package/dist/cjs/dimensional-model/filters/filters.test.d.ts +1 -0
  28. package/dist/cjs/dimensional-model/filters/filters.test.js +225 -0
  29. package/dist/cjs/dimensional-model/filters/utils/attribute-measure-util.d.ts +47 -0
  30. package/dist/cjs/dimensional-model/filters/utils/attribute-measure-util.js +111 -0
  31. package/dist/cjs/dimensional-model/filters/utils/condition-filter-util.d.ts +21 -0
  32. package/dist/cjs/dimensional-model/filters/utils/condition-filter-util.js +194 -0
  33. package/dist/cjs/dimensional-model/filters/utils/date-time-filter-util.d.ts +2 -0
  34. package/dist/cjs/dimensional-model/filters/utils/date-time-filter-util.js +12 -0
  35. package/dist/cjs/dimensional-model/filters/utils/filter-code-util.d.ts +13 -0
  36. package/dist/cjs/dimensional-model/filters/utils/filter-code-util.js +54 -0
  37. package/dist/cjs/dimensional-model/filters/utils/filter-code-util.test.d.ts +1 -0
  38. package/dist/cjs/dimensional-model/filters/utils/filter-code-util.test.js +32 -0
  39. package/dist/cjs/dimensional-model/filters/utils/filter-from-jaql-util.d.ts +73 -0
  40. package/dist/cjs/dimensional-model/filters/utils/filter-from-jaql-util.js +190 -0
  41. package/dist/cjs/dimensional-model/filters/utils/filter-from-jaql-util.test.d.ts +1 -0
  42. package/dist/cjs/dimensional-model/filters/utils/filter-from-jaql-util.test.js +558 -0
  43. package/dist/cjs/dimensional-model/filters/utils/filter-matcher-utils.d.ts +5 -0
  44. package/dist/cjs/dimensional-model/filters/utils/filter-matcher-utils.js +174 -0
  45. package/dist/cjs/dimensional-model/filters/utils/filter-matcher-utils.test.d.ts +1 -0
  46. package/dist/cjs/dimensional-model/filters/utils/filter-matcher-utils.test.js +236 -0
  47. package/dist/cjs/dimensional-model/filters/utils/filter-types-util.d.ts +17 -0
  48. package/dist/cjs/dimensional-model/filters/utils/filter-types-util.js +79 -0
  49. package/dist/cjs/dimensional-model/filters/utils/types.d.ts +200 -0
  50. package/dist/cjs/dimensional-model/filters/utils/types.js +99 -0
  51. package/dist/cjs/dimensional-model/interfaces.d.ts +512 -0
  52. package/dist/cjs/dimensional-model/interfaces.js +31 -0
  53. package/dist/cjs/dimensional-model/measures/factory.d.ts +920 -0
  54. package/dist/cjs/dimensional-model/measures/factory.js +1188 -0
  55. package/dist/cjs/dimensional-model/measures/factory.test.d.ts +1 -0
  56. package/dist/cjs/dimensional-model/measures/factory.test.js +481 -0
  57. package/dist/cjs/dimensional-model/measures/measures.d.ts +217 -0
  58. package/dist/cjs/dimensional-model/measures/measures.js +416 -0
  59. package/dist/cjs/dimensional-model/measures/measures.test.d.ts +1 -0
  60. package/dist/cjs/dimensional-model/measures/measures.test.js +79 -0
  61. package/dist/cjs/dimensional-model/simple-column-types.d.ts +39 -0
  62. package/dist/cjs/dimensional-model/simple-column-types.js +134 -0
  63. package/dist/cjs/dimensional-model/simple-column-types.test.d.ts +1 -0
  64. package/dist/cjs/dimensional-model/simple-column-types.test.js +85 -0
  65. package/dist/cjs/dimensional-model/types.d.ts +256 -0
  66. package/dist/cjs/dimensional-model/types.js +298 -0
  67. package/dist/cjs/dimensional-model/types.test.d.ts +1 -0
  68. package/dist/cjs/dimensional-model/types.test.js +33 -0
  69. package/dist/cjs/index.d.ts +93 -0
  70. package/dist/cjs/index.js +123 -0
  71. package/dist/cjs/interfaces.d.ts +367 -0
  72. package/dist/cjs/interfaces.js +21 -0
  73. package/dist/cjs/translation/initialize-i18n.d.ts +2 -0
  74. package/dist/cjs/translation/initialize-i18n.js +14 -0
  75. package/dist/cjs/translation/resources/en.d.ts +28 -0
  76. package/dist/cjs/translation/resources/en.js +30 -0
  77. package/dist/cjs/translation/resources/index.d.ts +53 -0
  78. package/dist/cjs/translation/resources/index.js +10 -0
  79. package/dist/cjs/translation/resources/uk.d.ts +5 -0
  80. package/dist/cjs/translation/resources/uk.js +30 -0
  81. package/dist/cjs/translation/translatable-error.d.ts +5 -0
  82. package/dist/cjs/translation/translatable-error.js +15 -0
  83. package/dist/cjs/utils.d.ts +37 -0
  84. package/dist/cjs/utils.js +105 -0
  85. package/dist/cjs/utils.test.d.ts +1 -0
  86. package/dist/cjs/utils.test.js +158 -0
  87. package/dist/dimensional-model/attributes.d.ts +1 -0
  88. package/dist/dimensional-model/attributes.js +31 -0
  89. package/dist/dimensional-model/filters/factory.d.ts +80 -42
  90. package/dist/dimensional-model/filters/factory.js +123 -85
  91. package/dist/dimensional-model/filters/filters.d.ts +40 -12
  92. package/dist/dimensional-model/filters/filters.js +75 -24
  93. package/dist/dimensional-model/filters/utils/attribute-measure-util.d.ts +2 -2
  94. package/dist/dimensional-model/filters/utils/attribute-measure-util.js +6 -3
  95. package/dist/dimensional-model/filters/utils/condition-filter-util.d.ts +4 -2
  96. package/dist/dimensional-model/filters/utils/condition-filter-util.js +34 -31
  97. package/dist/dimensional-model/filters/utils/filter-code-util.js +1 -1
  98. package/dist/dimensional-model/filters/utils/filter-from-jaql-util.d.ts +16 -10
  99. package/dist/dimensional-model/filters/utils/filter-from-jaql-util.js +34 -27
  100. package/dist/dimensional-model/filters/utils/filter-matcher-utils.d.ts +5 -0
  101. package/dist/dimensional-model/filters/utils/filter-matcher-utils.js +170 -0
  102. package/dist/dimensional-model/filters/utils/filter-types-util.d.ts +3 -1
  103. package/dist/dimensional-model/filters/utils/filter-types-util.js +2 -2
  104. package/dist/dimensional-model/filters/utils/types.d.ts +1 -1
  105. package/dist/dimensional-model/interfaces.d.ts +6 -0
  106. package/dist/dimensional-model/types.d.ts +9 -3
  107. package/dist/index.d.ts +1 -0
  108. package/dist/index.js +1 -0
  109. package/package.json +18 -9
@@ -0,0 +1,920 @@
1
+ import { Attribute, Measure, Filter, CalculatedMeasure, BaseMeasure, CustomFormulaContext } from '../interfaces.js';
2
+ import { ForecastFormulaOptions, TrendFormulaOptions } from '../../interfaces.js';
3
+ /**
4
+ * Defines the different numeric operators that can be used with numeric filters
5
+ *
6
+ * @internal
7
+ */
8
+ export declare const RankingTypes: {
9
+ /**
10
+ * In competition ranking, items that rank equally receive the same ranking number, and then a gap is left after the equally ranked items in the ranking numbers.
11
+ */
12
+ StandardCompetition: string;
13
+ /**
14
+ * In modified competition ranking, items that rank equally receive the same ranking number, and a gap is left before the equally ranked items in the ranking numbers.
15
+ */
16
+ ModifiedCompetition: string;
17
+ /**
18
+ * In dense ranking, items that rank equally receive the same ranking number, and the next items receive the immediately following ranking number.
19
+ */
20
+ Dense: string;
21
+ /**
22
+ * In ordinal ranking, all items receive distinct ordinal numbers, including items that rank equally. The assignment of distinct ordinal numbers for equal-ranking items is arbitrary.
23
+ */
24
+ Ordinal: string;
25
+ };
26
+ /**
27
+ * Defines the different ranking sorting types supported by rank measure
28
+ *
29
+ * @internal
30
+ */
31
+ export declare const RankingSortTypes: {
32
+ Ascending: string;
33
+ Descending: string;
34
+ };
35
+ /**
36
+ * Creates a calculated measure for a valid custom formula built from [base functions](https://docs.sisense.com/main/SisenseLinux/dashboard-functions-reference.htm).
37
+ *
38
+ * Use square brackets (`[]`) within the `formula` property to include dimensions or measures.
39
+ * Each unique dimension or measure included in the `formula` must be defined using a property:value pair in the `context` parameter.
40
+ *
41
+ * You can nest custom formulas by placing one inside the `formula` parameter of another.
42
+ *
43
+ * Note: To use [shared formulas](https://docs.sisense.com/main/SisenseLinux/shared-formulas.htm)
44
+ * from a Fusion Embed instance, you must fetch them first using {@link @sisense/sdk-ui!useGetSharedFormula | useGetSharedFormula}.
45
+ *
46
+ * @example
47
+ * An example of constructing a custom formulas using dimensions, measures, and nested custom formulas
48
+ * from the Sample Ecommerce data model.
49
+ * ```ts
50
+ * // Custom formula
51
+ * const profitabilityRatio = measureFactory.customFormula(
52
+ * 'Profitability Ratio',
53
+ * '([totalRevenue] - SUM([cost])) / [totalRevenue]',
54
+ * {
55
+ * totalRevenue: measureFactory.sum(DM.Commerce.Revenue),
56
+ * cost: DM.Commerce.Cost,
57
+ * },
58
+ * );
59
+ *
60
+ * // Nested custom formula
61
+ * const profitabilityRatioRank = measureFactory.customFormula(
62
+ * 'Profitability Ratio Rank',
63
+ * 'RANK([profRatio], "ASC", "1224")',
64
+ * {
65
+ * profRatio: profitabilityRatio,
66
+ * },
67
+ * );
68
+ * ```
69
+ * @param title - Title of the measure to be displayed in legend
70
+ * @param formula - Formula to be used for the measure
71
+ * @param context - Formula context as a map of strings to measures or attributes
72
+ * @returns A calculated measure instance
73
+ * @group Advanced Analytics
74
+ */
75
+ export declare function customFormula(title: string, formula: string, context: CustomFormulaContext): Attribute | Measure;
76
+ /**
77
+ * Creates an aggregated measure.
78
+ *
79
+ * This is a base function to build other aggregation functions (e.g., `sum`, `average`, etc.)
80
+ * as listed in {@link AggregationTypes}.
81
+ *
82
+ * @example
83
+ * Calculate the total cost across all items in a category from the Sample Ecommerce data model.
84
+ * ```ts
85
+ * measureFactory.aggregate(DM.Commerce.Cost, 'sum'),
86
+ * ```
87
+ * @param attribute - Attribute to aggregate
88
+ * @param aggregationType - Aggregation type. See {@link AggregationTypes}
89
+ * @param name - Optional name for the new measure
90
+ * @param format - Optional numeric formatting to apply using a Numeral.js format string. Can only be used for explicit queries. Cannot be used in charts, tables, etc.
91
+ * @returns A measure instance
92
+ * @group Aggregation
93
+ */
94
+ export declare function aggregate(attribute: Attribute, aggregationType: string, name?: string, format?: string): BaseMeasure;
95
+ /**
96
+ * Creates a calculated measure from a numeric value.
97
+ *
98
+ * @example
99
+ * Creates a calculated measure from a numeric value.
100
+ * ```ts
101
+ * measureFactory.constant(42)
102
+ * ```
103
+ * @param value - Value to be returned as a measure
104
+ * @returns A calculated measure instance
105
+ * @group Arithmetic
106
+ */
107
+ export declare function constant(value: number): CalculatedMeasure;
108
+ /**
109
+ * Creates a sum aggregation measure over the given attribute.
110
+ *
111
+ * To create a running sum, use {@link runningSum}.
112
+ *
113
+ * @example
114
+ * Calculate the total cost across all items in a category from the Sample Ecommerce data model.
115
+ * ```ts
116
+ * measureFactory.sum(DM.Commerce.Cost)
117
+ * ```
118
+ * @param attribute - Attribute to aggregate
119
+ * @param name - Optional name for the new measure
120
+ * @param format - Optional numeric formatting to apply using a Numeral.js format string. Can only be used for explicit queries. Cannot be used in charts, tables, etc.
121
+ * @returns A measure instance
122
+ * @group Aggregation
123
+ */
124
+ export declare function sum(attribute: Attribute, name?: string, format?: string): BaseMeasure;
125
+ /**
126
+ * Creates an average aggregation measure over the given attribute.
127
+ *
128
+ * Both `average()` and `avg()` can be used interchangeably.
129
+ *
130
+ * @example
131
+ * Calculate the average cost across all items in a category from the Sample Ecommerce data model.
132
+ * ```ts
133
+ * measureFactory.average(DM.Commerce.Cost)
134
+ * ```
135
+ * @param attribute - Attribute to aggregate
136
+ * @param name - Optional name for the new measure
137
+ * @param format - Optional numeric formatting to apply using a Numeral.js format string. Can only be used for explicit queries. Cannot be used in charts, tables, etc.
138
+ * @returns A measure instance
139
+ * @group Aggregation
140
+ */
141
+ export declare function average(attribute: Attribute, name?: string, format?: string): BaseMeasure;
142
+ /**
143
+ * {@inheritDoc average}
144
+ *
145
+ * @example
146
+ * Calculate the average cost across all items in a category from the Sample Ecommerce data model.
147
+ * ```ts
148
+ * measureFactory.avg(DM.Commerce.Cost)
149
+ * ```
150
+ * @group Aggregation
151
+ */
152
+ export declare function avg(attribute: Attribute, name?: string, format?: string): BaseMeasure;
153
+ /**
154
+ * Creates a min aggregation measure over the given attribute.
155
+ *
156
+ * @example
157
+ * Calculate the minimum cost across all items in a category from the Sample Ecommerce data model.
158
+ * ```ts
159
+ * measureFactory.min(DM.Commerce.Cost)
160
+ * ```
161
+ * @param attribute - Attribute to aggregate
162
+ * @param name - Optional name for the new measure
163
+ * @param format - Optional numeric formatting to apply using a Numeral.js format string. Can only be used for explicit queries. Cannot be used in charts, tables, etc.
164
+ * @returns A measure instance
165
+ * @group Aggregation
166
+ */
167
+ export declare function min(attribute: Attribute, name?: string, format?: string): BaseMeasure;
168
+ /**
169
+ * Creates a max aggregation measure over the given attribute.
170
+ *
171
+ * @example
172
+ * Calculate the maximum cost across all items in a category from the Sample Ecommerce data model.
173
+ * ```ts
174
+ * measureFactory.max(DM.Commerce.Cost)
175
+ * ```
176
+ * @param attribute - Attribute to aggregate
177
+ * @param name - Optional name for the new measure
178
+ * @param format - Optional numeric formatting to apply using a Numeral.js format string. Can only be used for explicit queries. Cannot be used in charts, tables, etc.
179
+ * @returns A measure instance
180
+ * @group Aggregation
181
+ */
182
+ export declare function max(attribute: Attribute, name?: string, format?: string): BaseMeasure;
183
+ /**
184
+ * Creates a median aggregation measure over the given attribute.
185
+ *
186
+ * @example
187
+ * Calculate the median cost across all items in a category from the Sample Ecommerce data model.
188
+ * ```ts
189
+ * measureFactory.median(DM.Commerce.Cost)
190
+ * ```
191
+ * @param attribute - Attribute to aggregate
192
+ * @param name - Optional name for the new measure
193
+ * @param format - Optional numeric formatting to apply using a Numeral.js format string. Can only be used for explicit queries. Cannot be used in charts, tables, etc.
194
+ * @returns A measure instance
195
+ * @group Aggregation
196
+ */
197
+ export declare function median(attribute: Attribute, name?: string, format?: string): BaseMeasure;
198
+ /**
199
+ * Creates a count aggregation measure over the given attribute.
200
+ *
201
+ * To count distinct values in the given attribute, use {@link countDistinct}.
202
+ *
203
+ * @example
204
+ * Counts the number of Commerce items from the Sample Ecommerce data model.
205
+ * ```ts
206
+ * measureFactory.count(DM.Commerce.BrandID)
207
+ * ```
208
+ * @param attribute - Attribute to aggregate
209
+ * @param name - Optional name for the new measure
210
+ * @param format - Optional numeric formatting to apply using a Numeral.js format string. Can only be used for explicit queries. Cannot be used in charts, tables, etc.
211
+ * @returns A measure instance
212
+ * @group Aggregation
213
+ */
214
+ export declare function count(attribute: Attribute, name?: string, format?: string): BaseMeasure;
215
+ /**
216
+ * Creates a count distinct aggregation measure over the given attribute.
217
+ *
218
+ * To count all values in the given attribute, use {@link count}.
219
+ *
220
+ * @example
221
+ * Calculate the number of distinct brands from the Sample Ecommerce data model.
222
+ * ```ts
223
+ * measureFactory.countDistinct(DM.Brand.BrandID)
224
+ * ```
225
+ * @param attribute - Attribute to aggregate
226
+ * @param name - Optional name for the new measure
227
+ * @param format - Optional numeric formatting to apply using a Numeral.js format string. Can only be used for explicit queries. Cannot be used in charts, tables, etc.
228
+ * @returns A measure instance
229
+ * @group Aggregation
230
+ */
231
+ export declare function countDistinct(attribute: Attribute, name?: string, format?: string): BaseMeasure;
232
+ /**
233
+ * Creates a measured value with the given measure and set of filters.
234
+ *
235
+ * A measured value only includes values from items that match the provided filters.
236
+ *
237
+ * For example you can use a measured value to get a total cost for all items where the cost is greater than 100.
238
+ *
239
+ * Note that the filters on the measured value override the filters on the query, chart, or table the
240
+ * measured value is used in.
241
+ *
242
+ * @example
243
+ * Calculate the total cost across all items in a category from the Sample Ecommerce data model,
244
+ * where the cost is greater than 100. Additional filtering on the cost will not affect this measure.
245
+ * ```ts
246
+ * measureFactory.measuredValue(
247
+ * measureFactory.sum(DM.Commerce.Cost),
248
+ * [filters.greaterThan(DM.Commerce.Cost, 100)],
249
+ * 'Cost Greater Than 100'
250
+ * ),
251
+ * ```
252
+ * @param measure - Measure to filter
253
+ * @param filters - Filters to apply to the measure
254
+ * @param name - Optional name for the new measure
255
+ * @param format - Optional numeric formatting to apply using a Numeral.js format string. Can only be used for explicit queries. Cannot be used in charts, tables, etc.
256
+ * @returns A calculated measure instance
257
+ * @group Advanced Analytics
258
+ */
259
+ export declare function measuredValue(measure: Measure, filters: Filter[], name?: string, format?: string): CalculatedMeasure;
260
+ /**
261
+ * Creates a calculated measure by adding two given numbers or measures.
262
+ *
263
+ * @example
264
+ * ```ts
265
+ * const measure1 = measureFactory.sum(DM.Dimension.Attribute1);
266
+ * const measure2 = measureFactory.sum(DM.Dimension.Attribute2);
267
+ * const measureSum = measureFactory.add(measure1, measure2);
268
+ * ```
269
+ * @param value1 - First value
270
+ * @param value2 - Second value
271
+ * @param name - Optional name for the new measure
272
+ * @param withParentheses - Optional boolean flag whether to wrap the arithmetic operation with parentheses
273
+ * @returns A calculated measure instance
274
+ * @group Arithmetic
275
+ */
276
+ export declare function add(value1: Measure | number, value2: Measure | number, name?: string, withParentheses?: boolean): CalculatedMeasure;
277
+ /**
278
+ * Creates a calculated measure by subtracting two given numbers or measures. Subtracts `value2` from `value1`.
279
+ *
280
+ * @example
281
+ * ```ts
282
+ * const measure1 = measureFactory.sum(DM.Dimension.Attribute1);
283
+ * const measure2 = measureFactory.sum(DM.Dimension.Attribute2);
284
+ * const measureDifference = measureFactory.subtract(measure1, measure2);
285
+ * ```
286
+ * @param value1 - First value
287
+ * @param value2 - Second value
288
+ * @param name - Optional name for the new measure
289
+ * @param withParentheses - Optional boolean flag whether to wrap the arithmetic operation with parentheses
290
+ * @returns A calculated measure instance
291
+ * @group Arithmetic
292
+ */
293
+ export declare function subtract(value1: Measure | number, value2: Measure | number, name?: string, withParentheses?: boolean): CalculatedMeasure;
294
+ /**
295
+ * Creates a calculated measure by multiplying two given numbers or measures.
296
+ *
297
+ * @example
298
+ * ```ts
299
+ * const measure1 = measureFactory.sum(DM.Dimension.Attribute1);
300
+ * const measure2 = measureFactory.sum(DM.Dimension.Attribute2);
301
+ * const measureProduct = measureFactory.multiply(measure1, measure2);
302
+ * ```
303
+ * @param value1 - First value
304
+ * @param value2 - Second value
305
+ * @param name - Optional name for the new measure
306
+ * @param withParentheses - Optional boolean flag whether to wrap the arithmetic operation with parentheses
307
+ * @returns A calculated measure instance
308
+ * @group Arithmetic
309
+ */
310
+ export declare function multiply(value1: Measure | number, value2: Measure | number, name?: string, withParentheses?: boolean): CalculatedMeasure;
311
+ /**
312
+ * Creates a calculated measure by dividing two given numbers or measures. Divides `value1` by `value2`.
313
+ *
314
+ * @example
315
+ * ```ts
316
+ * const measure1 = measureFactory.sum(DM.Dimension.Attribute1);
317
+ * const measure2 = measureFactory.sum(DM.Dimension.Attribute2);
318
+ * const measureQuotient = measureFactory.divide(measure1, measure2);
319
+ * ```
320
+ * @param value1 - First value
321
+ * @param value2 - Second value
322
+ * @param name - Optional name for the new measure
323
+ * @param withParentheses - Optional boolean flag whether to wrap the arithmetic operation with parentheses
324
+ * @returns A calculated measure instance
325
+ * @group Arithmetic
326
+ */
327
+ export declare function divide(value1: Measure | number, value2: Measure | number, name?: string, withParentheses?: boolean): CalculatedMeasure;
328
+ /**
329
+ * Creates a calculated measure that calculates the running total starting from the beginning
330
+ * of the year up to the current day, week, month, or quarter.
331
+ *
332
+ * The time resolution is determined by the minimum date level of the date dimension in the query
333
+ * that uses the returned measure.
334
+ *
335
+ * @example
336
+ * Calculate the running total of total cost from the Sample Ecommerce data model, starting from the
337
+ * beginning of the year up to the current day, week, month, or quarter.
338
+ * ```ts
339
+ * measureFactory.yearToDateSum(measureFactory.sum(DM.Commerce.Cost))
340
+ * ```
341
+ * @param measure - Measure to apply the YTD Sum to
342
+ * @param name - Name for the new measure
343
+ * @returns A calculated measure instance
344
+ * @group Time-based
345
+ */
346
+ export declare function yearToDateSum(measure: Measure, name?: string): CalculatedMeasure;
347
+ /**
348
+ * Creates a calculated measure that calculates the running total starting from the beginning
349
+ * of the quarter up to the current day, week, or month.
350
+ *
351
+ * The time resolution is determined by the minimum date level of the date dimension in the query
352
+ * that uses the returned measure.
353
+ *
354
+ * @example
355
+ * Calculate the running total of total cost from the Sample Ecommerce data model, starting from the
356
+ * beginning of the quarter up to the current day, week, or month.
357
+ * ```ts
358
+ * measureFactory.quarterToDateSum(measureFactory.sum(DM.Commerce.Cost))
359
+ * ```
360
+ * @param measure - Measure to apply the QTD Sum to
361
+ * @param name - Name for the new measure
362
+ * @returns A calculated measure instance
363
+ * @group Time-based
364
+ */
365
+ export declare function quarterToDateSum(measure: Measure, name?: string): CalculatedMeasure;
366
+ /**
367
+ * Creates a calculated measure that calculates the running total starting from the beginning
368
+ * of the month up to the current day or week.
369
+ *
370
+ * The time resolution is determined by the minimum date level of the date dimension in the query
371
+ * that uses the returned measure.
372
+ *
373
+ * @example
374
+ * Calculate the running total of total cost from the Sample Ecommerce data model, starting from the
375
+ * beginning of the month up to the current day or week.
376
+ * ```ts
377
+ * measureFactory.monthToDateSum(measureFactory.sum(DM.Commerce.Cost))
378
+ * ```
379
+ * @param measure - Measure to apply the MTD Sum to
380
+ * @param name - Name for the new measure
381
+ * @returns A calculated measure instance
382
+ * @group Time-based
383
+ */
384
+ export declare function monthToDateSum(measure: Measure, name?: string): CalculatedMeasure;
385
+ /**
386
+ * Creates a calculated measure that calculates the running total starting from the beginning
387
+ * of the week up to the current day.
388
+ *
389
+ * The time resolution is determined by the minimum date level of the date dimension in the query
390
+ * that uses the returned measure.
391
+ *
392
+ * @example
393
+ * Calculate the running total of total cost from the Sample Ecommerce data model, starting from the
394
+ * beginning of the week up to the current day.
395
+ * ```ts
396
+ * measureFactory.weekToDateSum(measureFactory.sum(DM.Commerce.Cost))
397
+ * ```
398
+ * @param measure - Measure to apply the WTD Sum to
399
+ * @param name - Name for the new measure
400
+ * @returns A calculated measure instance
401
+ * @group Time-based
402
+ */
403
+ export declare function weekToDateSum(measure: Measure, name?: string): CalculatedMeasure;
404
+ /**
405
+ * Creates a calculated measure that calculates the running total of a given measure.
406
+ *
407
+ * The running sum is calculated using the current sort order of the query it's used in.
408
+ *
409
+ * @example
410
+ * Calculate the running sum of the total cost from the Sample Ecommerce data model across all categories.
411
+ * ```ts
412
+ * measureFactory.runningSum(measureFactory.sum(DM.Commerce.Cost)),
413
+ * ```
414
+ *
415
+ * Running sum values from the Sample Ecommerce data model when categorizing by age range.
416
+ * | AgeRange | Cost | Running Cost |
417
+ * | --- | --- | --- |
418
+ * | 0-18 | 4.32M | 4.32M |
419
+ * | 19-24 | 8.66M | 12.98M |
420
+ * | 25-34 | 21.19M | 34.16M |
421
+ * | 35-44 | 23.64M | 57.8M |
422
+ * | 45-54 | 20.39M | 78.19M |
423
+ * | 55-64 | 11.82M | 90.01M |
424
+ * | 65+ | 17.26M | 107.27M |
425
+ * @param measure - Measure to apply the running sum to
426
+ * @param _continuous - Boolean flag whether to accumulate the sum continuously
427
+ * when there are two or more dimensions. The default value is false.
428
+ * @param name - Name for the new measure
429
+ * @returns A calculated measure instance
430
+ * @group Statistics
431
+ */
432
+ export declare function runningSum(measure: Measure, _continuous?: boolean, name?: string): CalculatedMeasure;
433
+ /**
434
+ * Creates a calculated measure that calculates growth over a period of time.
435
+ *
436
+ * The time resolution is determined by the minimum date level of the date dimension in the query
437
+ * that uses the returned measure.
438
+ *
439
+ * Growth is calculated using the following formula: `(currentPeriod – previousPeriod) / previousPeriod`.
440
+ *
441
+ * For example, if this period the value is 12 and the previous period's value was 10, the growth for
442
+ * this period is 20%, returned as '0.2' (calculation: `(12 – 10) / 10 = 0.2`).
443
+ *
444
+ * If the previous period's value is greater than the current period, the growth will be negative.
445
+ *
446
+ * For example, if this period the value is 80, and the previous period's was 100, the growth for
447
+ * this period is -20%, returned as `-0.2` (calculation: `(80 – 100) / 100 = -0.2`).
448
+ *
449
+ * @example
450
+ * Calculate the growth in total cost this period in comparison to the previous period from the
451
+ * Sample Ecommerce data model.
452
+ * ```ts
453
+ * measureFactory.growth(measureFactory.sum(DM.Commerce.Cost))
454
+ * ```
455
+ * @param measure - Measure to apply growth to
456
+ * @param name - Name for the new measure
457
+ * @returns A calculated measure instance
458
+ * @group Statistics
459
+ */
460
+ export declare function growth(measure: Measure, name?: string): CalculatedMeasure;
461
+ /**
462
+ * Creates a calculated measure that calculates growth rate over a period of time.
463
+ *
464
+ * The time resolution is determined by the minimum date level of the date dimension in the query
465
+ * that uses the returned measure.
466
+ *
467
+ * Growth rate is calculated using the following formula: `currentPeriod / previousPeriod`.
468
+ *
469
+ * For example, if this period the value is 12 and the previous period's value was 10, the growth rate for
470
+ * this period is 120%, returned as '1.2' (calculation: `12 / 10 = 1.2`).
471
+ *
472
+ * If the previous period's value is greater than the current period, the growth rate will be less than one.
473
+ *
474
+ * For example, if this period the value is 80, and the previous period's was 100, the growth for
475
+ * this period is 80%, returned as `0.8` (calculation: `80 / 100 = .8`).
476
+ *
477
+ * @example
478
+ * Calculate the growth rate in total cost this period in comparison to the previous period from the
479
+ * Sample Ecommerce data model.
480
+ * ```ts
481
+ * measureFactory.growthRate(measureFactory.sum(DM.Commerce.Cost))
482
+ * ```
483
+ * @param measure - Measure to apply the Growth rate
484
+ * @param name - Name for the new measure
485
+ * @returns A calculated measure instance
486
+ * @group Statistics
487
+ */
488
+ export declare function growthRate(measure: Measure, name?: string): CalculatedMeasure;
489
+ /**
490
+ * Creates a calculated measure that calculates the growth from the previous week to the current week.
491
+ *
492
+ * The date dimension will be dynamically taken from the query that uses the returned measure.
493
+ *
494
+ * Growth is calculated using the following formula: `(currentWeek – previousWeek) / previousWeek`.
495
+ *
496
+ * For example, if this week the value is 12 and the previous week's value was 10, the growth for
497
+ * this week is 20%, returned as '0.2' (calculation: `(12 – 10) / 10 = 0.2`).
498
+ *
499
+ * If the previous week's value is greater than the current week, the growth will be negative.
500
+ *
501
+ * For example, if this week the value is 80, and the previous week's was 100, the growth for
502
+ * this week is -20%, returned as `-0.2` (calculation: `(80 – 100) / 100 = -0.2`).
503
+ *
504
+ * @example
505
+ * Calculate the growth in total cost this week in comparison to the previous week from the Sample
506
+ * Ecommerce data model.
507
+ * ```ts
508
+ * measureFactory.growthPastWeek(measureFactory.sum(DM.Commerce.Cost))
509
+ * ```
510
+ * @param measure - Measure to apply growth to
511
+ * @param name - Name for the new measure
512
+ * @returns A calculated measure instance
513
+ * @group Statistics
514
+ */
515
+ export declare function growthPastWeek(measure: Measure, name?: string): CalculatedMeasure;
516
+ /**
517
+ * Creates a calculated measure that calculates the growth from the previous month to the current month.
518
+ *
519
+ * The date dimension will be dynamically taken from the query that uses the returned measure.
520
+ *
521
+ * Growth is calculated using the following formula: `(currentMonth – previousMonth) / previousMonth`.
522
+ *
523
+ * For example, if this month the value is 12 and the previous month's value was 10, the growth for
524
+ * this month is 20%, returned as '0.2' (calculation: `(12 – 10) / 10 = 0.2`).
525
+ *
526
+ * If the previous month's value is greater than the current month, the growth will be negative.
527
+ *
528
+ * For example, if this month the value is 80, and the previous month's was 100, the growth for
529
+ * this month is -20%, returned as `-0.2` (calculation: `(80 – 100) / 100 = -0.2`).
530
+ *
531
+ * @example
532
+ * Calculate the growth in total cost this month in comparison to the previous month from the Sample
533
+ * Ecommerce data model.
534
+ * ```ts
535
+ * measureFactory.growthPastMonth(measureFactory.sum(DM.Commerce.Cost))
536
+ * ```
537
+ * @param measure - Measure to apply growth to
538
+ * @param name - Name for the new measure
539
+ * @returns A calculated measure instance
540
+ * @group Statistics
541
+ */
542
+ export declare function growthPastMonth(measure: Measure, name?: string): CalculatedMeasure;
543
+ /**
544
+ * Creates a calculated measure that calculates the growth from the previous quarter to the current quarter.
545
+ *
546
+ * The date dimension will be dynamically taken from the query that uses the returned measure.
547
+ *
548
+ * Growth is calculated using the following formula: `(currentQuarter – previousQuarter) / previousQuarter`.
549
+ *
550
+ * For example, if this quarter the value is 12 and the previous quarter's value was 10, the growth for
551
+ * this quarter is 20%, returned as '0.2' (calculation: `(12 – 10) / 10 = 0.2`).
552
+ *
553
+ * If the previous quarter's value is greater than the current quarter, the growth will be negative.
554
+ *
555
+ * For example, if this quarter the value is 80, and the previous quarter's was 100, the growth for
556
+ * this quarter is -20%, returned as `-0.2` (calculation: `(80 – 100) / 100 = -0.2`).
557
+ *
558
+ * @example
559
+ * Calculate the growth in total cost this quarter in comparison to the previous quarter from the
560
+ * Sample Ecommerce data model.
561
+ * ```ts
562
+ * measureFactory.growthPastQuarter(measureFactory.sum(DM.Commerce.Cost))
563
+ * ```
564
+ * @param measure - Measure to apply growth to
565
+ * @param name - Name for the new measure
566
+ * @returns A calculated measure instance
567
+ * @group Statistics
568
+ */
569
+ export declare function growthPastQuarter(measure: Measure, name?: string): CalculatedMeasure;
570
+ /**
571
+ * Creates a calculated measure that calculates the growth from the previous year to the current year.
572
+ *
573
+ * The date dimension will be dynamically taken from the query that uses the returned measure.
574
+ *
575
+ * Growth is calculated using the following formula: `(currentYear – previousYear) / previousYear`.
576
+ *
577
+ * For example, if this year the value is 12 and the previous year's value was 10, the growth for
578
+ * this year is 20%, returned as '0.2' (calculation: `(12 – 10) / 10 = 0.2`).
579
+ *
580
+ * If the previous year's value is greater than the current year, the growth will be negative.
581
+ *
582
+ * For example, if this year the value is 80, and the previous year's was 100, the growth for
583
+ * this year is -20%, returned as `-0.2` (calculation: `(80 – 100) / 100 = -0.2`).
584
+ *
585
+ * @example
586
+ * Calculate the growth in total cost this year in comparison to the previous year from the Sample
587
+ * Ecommerce data model.
588
+ * ```ts
589
+ * measureFactory.growthPastYear(measureFactory.sum(DM.Commerce.Cost))
590
+ * ```
591
+ * @param measure - Measure to apply growth to
592
+ * @param name - Name for the new measure
593
+ * @returns A calculated measure instance
594
+ * @group Statistics
595
+ */
596
+ export declare function growthPastYear(measure: Measure, name?: string): CalculatedMeasure;
597
+ /**
598
+ * Creates a calculated measure that calculates the difference between this period's data
599
+ * and the data from the previous period for the given measure.
600
+ *
601
+ * The time resolution is determined by the minimum date level of the date dimension in the query
602
+ * that uses the returned measure.
603
+ *
604
+ * @example
605
+ * Calculate the difference between this period's total cost and the previous period's total cost
606
+ * from the Sample Ecommerce data model.
607
+ * ```ts
608
+ * measureFactory.difference(measureFactory.sum(DM.Commerce.Cost))
609
+ * ```
610
+ * @param measure - Measure to apply difference to
611
+ * @param name - Name for the new measure
612
+ * @returns A calculated measure instance
613
+ * @group Time-based
614
+ */
615
+ export declare function difference(measure: Measure, name?: string): CalculatedMeasure;
616
+ /**
617
+ * Creates a calculated measure that calculates the difference between this week's data
618
+ * and the data from the previous week for the given measure.
619
+ *
620
+ * The date dimension will be dynamically taken from the query that uses the returned measure.
621
+ *
622
+ * @example
623
+ * Calculate the difference between this week's total cost and the previous week's total cost from
624
+ * the Sample Ecommerce data model.
625
+ * ```ts
626
+ * measureFactory.diffPastWeek(measureFactory.sum(DM.Commerce.Cost))
627
+ * ```
628
+ * @param measure - Measure to apply difference to
629
+ * @param name - Name for the new measure
630
+ * @returns A calculated measure instance
631
+ * @group Time-based
632
+ */
633
+ export declare function diffPastWeek(measure: Measure, name?: string): CalculatedMeasure;
634
+ /**
635
+ * Creates a calculated measure that calculates the difference between this month's data
636
+ * and the data from the previous month for the given measure.
637
+ *
638
+ * The date dimension will be dynamically taken from the query that uses the returned measure.
639
+ *
640
+ * @example
641
+ * Calculate the difference between this month's total cost and the previous month's total cost from
642
+ * the Sample Ecommerce data model.
643
+ * ```ts
644
+ * measureFactory.diffPastMonth(measureFactory.sum(DM.Commerce.Cost))
645
+ * ```
646
+ * @param measure - Measure to apply difference to
647
+ * @param name - Name for the new measure
648
+ * @returns A calculated measure instance
649
+ * @group Time-based
650
+ */
651
+ export declare function diffPastMonth(measure: Measure, name?: string): CalculatedMeasure;
652
+ /**
653
+ * Creates a calculated measure that calculates the difference between this quarter's data
654
+ * and the data from the previous quarter for the given measure.
655
+ *
656
+ * The date dimension will be dynamically taken from the query that uses the returned measure.
657
+ *
658
+ * @example
659
+ * Calculate the difference between this quarter's total cost and the previous quarter's total cost
660
+ * from the Sample Ecommerce data model.
661
+ * ```ts
662
+ * measureFactory.diffPastQuarter(measureFactory.sum(DM.Commerce.Cost))
663
+ * ```
664
+ * @param measure - Measure to apply difference to
665
+ * @param name - Name for the new measure
666
+ * @returns A calculated measure instance
667
+ * @group Time-based
668
+ */
669
+ export declare function diffPastQuarter(measure: Measure, name?: string): CalculatedMeasure;
670
+ /**
671
+ * Creates a calculated measure that calculates the difference between this year's data
672
+ * and the data from the previous year for the given measure.
673
+ *
674
+ * The date dimension will be dynamically taken from the query that uses the returned measure.
675
+ *
676
+ * @example
677
+ * Calculate the difference between this year's total cost and the previous year's total cost from
678
+ * the Sample Ecommerce data model.
679
+ * ```ts
680
+ * measureFactory.diffPastYear(measureFactory.sum(DM.Commerce.Cost))
681
+ * ```
682
+ * @param measure - Measure to apply difference to
683
+ * @param name - Name for the new measure
684
+ * @returns A calculated measure instance
685
+ * @group Time-based
686
+ */
687
+ export declare function diffPastYear(measure: Measure, name?: string): CalculatedMeasure;
688
+ /**
689
+ * Creates a calculated measure that calculates the value for the previous day.
690
+ *
691
+ * @example
692
+ * Calculate total cost for the previous day from the Sample Ecommerce data model.
693
+ * ```ts
694
+ * measureFactory.pastDay(measureFactory.sum(DM.Commerce.Cost))
695
+ * ```
696
+ * @param measure - Measure to apply past value to
697
+ * @param name - Name for the new measure
698
+ * @returns A calculated measure instance
699
+ * @group Time-based
700
+ */
701
+ export declare function pastDay(measure: Measure, name?: string): CalculatedMeasure;
702
+ /**
703
+ * Creates a calculated measure that calculates the value for the same day in the previous week.
704
+ *
705
+ * The time resolution is determined by the minimum date level of the date dimension in the query
706
+ * that uses the returned measure.
707
+ *
708
+ * @example
709
+ * Calculate total cost for the corresponding day one week ago from the Sample Ecommerce data model.
710
+ * ```ts
711
+ * measureFactory.pastWeek(measureFactory.sum(DM.Commerce.Cost))
712
+ * ```
713
+ * @param measure - Measure to apply past value to
714
+ * @param name - Name for the new measure
715
+ * @returns A calculated measure instance
716
+ * @group Time-based
717
+ */
718
+ export declare function pastWeek(measure: Measure, name?: string): CalculatedMeasure;
719
+ /**
720
+ * Creates a calculated measure that calculates the value for the same day or week in the previous month.
721
+ *
722
+ * The time resolution is determined by the minimum date level of the date dimension in the query
723
+ * that uses the returned measure.
724
+ *
725
+ * @example
726
+ * Calculate total cost for the corresponding day or week one month ago from the Sample Ecommerce
727
+ * data model.
728
+ * ```ts
729
+ * measureFactory.pastMonth(measureFactory.sum(DM.Commerce.Cost))
730
+ * ```
731
+ * @param measure - Measure to apply past value to
732
+ * @param name - Name for the new measure
733
+ * @returns A calculated measure instance
734
+ * @group Time-based
735
+ */
736
+ export declare function pastMonth(measure: Measure, name?: string): CalculatedMeasure;
737
+ /**
738
+ * Creates a calculated measure that calculates the value for the same day, week, or month in the previous quarter.
739
+ *
740
+ * The time resolution is determined by the minimum date level of the date dimension in the query
741
+ * that uses the returned measure.
742
+ *
743
+ * @example
744
+ * Calculate total cost for the corresponding day, week, or month one quarter ago from the Sample
745
+ * Ecommerce data model.
746
+ * ```ts
747
+ * measureFactory.pastQuarter(measureFactory.sum(DM.Commerce.Cost))
748
+ * ```
749
+ * @param measure - Measure to apply past value to
750
+ * @param name - Name for the new measure
751
+ * @returns A calculated measure instance
752
+ * @group Time-based
753
+ */
754
+ export declare function pastQuarter(measure: Measure, name?: string): CalculatedMeasure;
755
+ /**
756
+ * Creates a calculated measure that calculates the value for the same day, week, month, or quarter in the previous year.
757
+ *
758
+ * The time resolution is determined by the minimum date level of the date dimension in the query
759
+ * that uses the returned measure.
760
+ *
761
+ * @example
762
+ * Calculate total cost for the corresponding day, week, month, or quarter one year ago from the
763
+ * Sample Ecommerce data model.
764
+ * ```ts
765
+ * measureFactory.pastYear(measureFactory.sum(DM.Commerce.Cost))
766
+ * ```
767
+ * @param measure - Measure to apply past value to
768
+ * @param name - Name for the new measure
769
+ * @returns A calculated measure instance
770
+ * @group Time-based
771
+ */
772
+ export declare function pastYear(measure: Measure, name?: string): CalculatedMeasure;
773
+ /**
774
+ * Creates a calculated contribution measure.
775
+ *
776
+ * A contribution measure calculates the contribution, in percentage, of a measure towards the total.
777
+ * Percentages are expressed as a number between 0 and 1 (e.g. 42% is `0.42`).
778
+ *
779
+ * For example, using the Sample Ecommerce data model you can retrieve the total cost of products
780
+ * categorized by age range. Using a contribution measure you can calculate how much each age range's
781
+ * total cost contributes to the total cost across all age ranges. So, the total cost for the 35-44
782
+ * age range is 23.64M, which is 22% of the 107.27M of all age ranges together. Therefore, the
783
+ * contribution of the 35-44 age range is `.22`.
784
+ *
785
+ * @example
786
+ * Calculates the percentage of the total cost across all categories for items in a category from the
787
+ * Sample Ecommerce data model.
788
+ * ```ts
789
+ * measureFactory.contribution(measureFactory.sum(DM.Commerce.Cost))
790
+ * ```
791
+ *
792
+ * Contribution values from the Sample Ecommerce data model when categorizing by age range.
793
+ * | AgeRange | Cost | Contribution |
794
+ * | --- | --- | --- |
795
+ * | 0-18 | 4.32M | 0.04 |
796
+ * | 19-24 | 8.66M | 0.08 |
797
+ * | 25-34 | 21.19M | 0.2 |
798
+ * | 35-44 | 23.64M | 0.22 |
799
+ * | 45-54 | 20.39M | 0.19 |
800
+ * | 55-64 | 11.82M | 0.11 |
801
+ * | 65+ | 17.26M | 0.16 |
802
+ * @param measure - Measure to apply the Contribution logic to
803
+ * @param name - Name for the new measure
804
+ * @returns A calculated measure instance
805
+ * @group Statistics
806
+ */
807
+ export declare function contribution(measure: Measure, name?: string): CalculatedMeasure;
808
+ /**
809
+ * Creates a calculated measure that computes a specified trend type for a given measure.
810
+ *
811
+ * The trend types include linear (the default), logarithmic, advanced smoothing, and local estimates.
812
+ * You can also opt to automatically identify and ignore anomalous values in the series.
813
+ *
814
+ * Trend requires a Sisense instance version of L2023.6.0 or greater.
815
+ *
816
+ * @example
817
+ * Calculate the trend in total cost from the Sample Ecommerce data model.
818
+ * ```ts
819
+ * measureFactory.trend(
820
+ * measureFactory.sum(DM.Commerce.Cost),
821
+ * 'Total Cost Trend',
822
+ * {
823
+ * modelType: 'advancedSmoothing',
824
+ * ignoreAnomalies: true,
825
+ * }
826
+ * )
827
+ * ```
828
+ * @param measure - Measure to apply the trend logic to
829
+ * @param name - Name for the new measure
830
+ * @param options - Trend options
831
+ * @returns A calculated measure instance
832
+ * @group Advanced Analytics
833
+ */
834
+ export declare function trend(measure: Measure, name?: string, options?: TrendFormulaOptions): CalculatedMeasure;
835
+ /**
836
+ * Creates a calculated measure that generates a forecast based on a specified measure employing
837
+ * advanced autoML techniques.
838
+ *
839
+ * This function offers flexible options allowing you to:
840
+ * + Let the function auto-select the best statistical model or explicitly choose a preferred model
841
+ * + Control the time period used for training the model
842
+ * + Set additional options to improve forecast accuracy by supplying expected lower and upper limits.
843
+ *
844
+ * In addition to the forecast, upper and lower confidence intervals are returned
845
+ * with the name of the new measure and a suffix of _upper and _lower
846
+ * respectively.
847
+ *
848
+ * Forecast requires a Sisense instance version of L2023.6.0 or greater.
849
+ *
850
+ * @example
851
+ * Calculate a forecast for total cost from the Sample Ecommerce data model from the Sample
852
+ * Ecommerce data model.
853
+ * ```ts
854
+ * measureFactory.forecast(
855
+ * measureFactory.sum(DM.Commerce.Cost),
856
+ * 'Total Cost Forecast',
857
+ * {
858
+ * modelType: 'prophet',
859
+ * roundToInt: true,
860
+ * }
861
+ * )
862
+ * ```
863
+ * @param measure - Measure to apply the forecast logic to
864
+ * @param name - Name for the new measure
865
+ * @param options - Forecast options
866
+ * @returns A calculated measure instance
867
+ * @group Advanced Analytics
868
+ */
869
+ export declare function forecast(measure: Measure, name?: string, options?: ForecastFormulaOptions): CalculatedMeasure;
870
+ /**
871
+ * Creates a calculated measure that calculates the rank of a value in a list of values.
872
+ *
873
+ * This function includes options that allow you do customize the ranking order and how to handle
874
+ * equally ranked items.
875
+ *
876
+ * The order options are:
877
+ * + `'DESC'` (default): Descending, meaning the largest number is ranked first.
878
+ * + `'ASC'`: Ascending, meaning the smallest number is ranked first.
879
+ *
880
+ * The rank type options are:
881
+ * + `'1224'`: Standard competition, meaning items that rank equally receive the same ranking number,
882
+ * and then a gap is left after the equally ranked items in the ranking numbers.
883
+ * + `'1334'`: Modified competition ranking, meaning items that rank equally receive the same ranking number,
884
+ * and a gap is left before the equally ranked items in the ranking numbers.
885
+ * + `'1223'`: Dense ranking, meaning items that rank equally receive the same ranking number,
886
+ * and the next items receive the immediately following ranking number.
887
+ * + `'1234'`: Ordinal ranking, meaning all items receive distinct ordinal numbers,
888
+ * including items that rank equally. The assignment of distinct ordinal numbers for equal-ranking items is arbitrary.
889
+ *
890
+ * @example
891
+ * Calculate the rank of the total cost per category, sorted with the smallest cost ranked first,
892
+ * and ranking ties are handled using the ordinal ranking type from the Sample Ecommerce data model.
893
+ * ```ts
894
+ * measureFactory.rank(
895
+ * measureFactory.sum(DM.Commerce.Cost),
896
+ * 'Cost Rank',
897
+ * measureFactory.RankingSortTypes.Ascending,
898
+ * measureFactory.RankingTypes.Ordinal
899
+ * )
900
+ * ```
901
+ *
902
+ * Ranking values from the Sample Ecommerce data model when categorizing by age range using the above ranking.
903
+ * | AgeRange | Cost | Cost Rank |
904
+ * | --- | --- | --- |
905
+ * | 0-18 | 4.32M | 1 |
906
+ * | 19-24 | 8.66M | 2 |
907
+ * | 25-34 | 21.19M | 6 |
908
+ * | 35-44 | 23.64M | 7 |
909
+ * | 45-54 | 20.39M | 5 |
910
+ * | 55-64 | 11.82M | 3 |
911
+ * | 65+ | 17.26M | 4 |
912
+ * @param measure - Measure to apply the ranking logic to
913
+ * @param name - Name for the new measure
914
+ * @param sort - Sorting for ranking. By default sort order is descending, where the largest number is ranked first.
915
+ * @param rankType - How to handle equally ranked items. By default the type is standard competition ranking.
916
+ * @param groupBy - Rank partition attributes
917
+ * @returns A calculated measure instance
918
+ * @group Statistics
919
+ */
920
+ export declare function rank(measure: Measure, name?: string, sort?: string, rankType?: string, groupBy?: Attribute[]): CalculatedMeasure;