@gooddata/sdk-maql-language-server 0.0.0-stage → 11.65.0-alpha.11

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 (314) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +118 -2
  3. package/esm/completions/complete.d.ts +12 -0
  4. package/esm/completions/complete.d.ts.map +1 -0
  5. package/esm/completions/complete.js +316 -0
  6. package/esm/completions/descriptions.d.ts +42 -0
  7. package/esm/completions/descriptions.d.ts.map +1 -0
  8. package/esm/completions/descriptions.js +289 -0
  9. package/esm/completions/findContext.d.ts +19 -0
  10. package/esm/completions/findContext.d.ts.map +1 -0
  11. package/esm/completions/findContext.js +171 -0
  12. package/esm/completions/functionDescriptions.d.ts +3 -0
  13. package/esm/completions/functionDescriptions.d.ts.map +1 -0
  14. package/esm/completions/functionDescriptions.js +98 -0
  15. package/esm/completions/sort.d.ts +4 -0
  16. package/esm/completions/sort.d.ts.map +1 -0
  17. package/esm/completions/sort.js +88 -0
  18. package/esm/constants.d.ts +21 -0
  19. package/esm/constants.d.ts.map +1 -0
  20. package/esm/constants.js +22 -0
  21. package/esm/dateElementFormat.d.ts +9 -0
  22. package/esm/dateElementFormat.d.ts.map +1 -0
  23. package/esm/dateElementFormat.js +60 -0
  24. package/esm/decorations.d.ts +46 -0
  25. package/esm/decorations.d.ts.map +1 -0
  26. package/esm/decorations.js +42 -0
  27. package/esm/diagnostics.d.ts +12 -0
  28. package/esm/diagnostics.d.ts.map +1 -0
  29. package/esm/diagnostics.js +259 -0
  30. package/esm/docs/en/docs/create-metrics/maql/aggregation/approximate_count.d.ts +2 -0
  31. package/esm/docs/en/docs/create-metrics/maql/aggregation/approximate_count.d.ts.map +1 -0
  32. package/esm/docs/en/docs/create-metrics/maql/aggregation/approximate_count.js +61 -0
  33. package/esm/docs/en/docs/create-metrics/maql/aggregation/avg.d.ts +2 -0
  34. package/esm/docs/en/docs/create-metrics/maql/aggregation/avg.d.ts.map +1 -0
  35. package/esm/docs/en/docs/create-metrics/maql/aggregation/avg.js +19 -0
  36. package/esm/docs/en/docs/create-metrics/maql/aggregation/count.d.ts +2 -0
  37. package/esm/docs/en/docs/create-metrics/maql/aggregation/count.d.ts.map +1 -0
  38. package/esm/docs/en/docs/create-metrics/maql/aggregation/count.js +72 -0
  39. package/esm/docs/en/docs/create-metrics/maql/aggregation/first.d.ts +2 -0
  40. package/esm/docs/en/docs/create-metrics/maql/aggregation/first.d.ts.map +1 -0
  41. package/esm/docs/en/docs/create-metrics/maql/aggregation/first.js +41 -0
  42. package/esm/docs/en/docs/create-metrics/maql/aggregation/last.d.ts +2 -0
  43. package/esm/docs/en/docs/create-metrics/maql/aggregation/last.d.ts.map +1 -0
  44. package/esm/docs/en/docs/create-metrics/maql/aggregation/last.js +69 -0
  45. package/esm/docs/en/docs/create-metrics/maql/aggregation/max.d.ts +2 -0
  46. package/esm/docs/en/docs/create-metrics/maql/aggregation/max.d.ts.map +1 -0
  47. package/esm/docs/en/docs/create-metrics/maql/aggregation/max.js +61 -0
  48. package/esm/docs/en/docs/create-metrics/maql/aggregation/median.d.ts +2 -0
  49. package/esm/docs/en/docs/create-metrics/maql/aggregation/median.d.ts.map +1 -0
  50. package/esm/docs/en/docs/create-metrics/maql/aggregation/median.js +25 -0
  51. package/esm/docs/en/docs/create-metrics/maql/aggregation/min.d.ts +2 -0
  52. package/esm/docs/en/docs/create-metrics/maql/aggregation/min.d.ts.map +1 -0
  53. package/esm/docs/en/docs/create-metrics/maql/aggregation/min.js +63 -0
  54. package/esm/docs/en/docs/create-metrics/maql/aggregation/sum.d.ts +2 -0
  55. package/esm/docs/en/docs/create-metrics/maql/aggregation/sum.d.ts.map +1 -0
  56. package/esm/docs/en/docs/create-metrics/maql/aggregation/sum.js +20 -0
  57. package/esm/docs/en/docs/create-metrics/maql/conditionals/case.d.ts +2 -0
  58. package/esm/docs/en/docs/create-metrics/maql/conditionals/case.d.ts.map +1 -0
  59. package/esm/docs/en/docs/create-metrics/maql/conditionals/case.js +73 -0
  60. package/esm/docs/en/docs/create-metrics/maql/conditionals/if-then-else.d.ts +2 -0
  61. package/esm/docs/en/docs/create-metrics/maql/conditionals/if-then-else.d.ts.map +1 -0
  62. package/esm/docs/en/docs/create-metrics/maql/conditionals/if-then-else.js +29 -0
  63. package/esm/docs/en/docs/create-metrics/maql/conditionals/ifnull.d.ts +2 -0
  64. package/esm/docs/en/docs/create-metrics/maql/conditionals/ifnull.d.ts.map +1 -0
  65. package/esm/docs/en/docs/create-metrics/maql/conditionals/ifnull.js +96 -0
  66. package/esm/docs/en/docs/create-metrics/maql/filters/filtering-with-ranking-filters.d.ts +2 -0
  67. package/esm/docs/en/docs/create-metrics/maql/filters/filtering-with-ranking-filters.d.ts.map +1 -0
  68. package/esm/docs/en/docs/create-metrics/maql/filters/filtering-with-ranking-filters.js +71 -0
  69. package/esm/docs/en/docs/create-metrics/maql/filters/filtering-with-the-having-clause.d.ts +2 -0
  70. package/esm/docs/en/docs/create-metrics/maql/filters/filtering-with-the-having-clause.d.ts.map +1 -0
  71. package/esm/docs/en/docs/create-metrics/maql/filters/filtering-with-the-having-clause.js +65 -0
  72. package/esm/docs/en/docs/create-metrics/maql/filters/filtering-with-the-like-clause.d.ts +2 -0
  73. package/esm/docs/en/docs/create-metrics/maql/filters/filtering-with-the-like-clause.d.ts.map +1 -0
  74. package/esm/docs/en/docs/create-metrics/maql/filters/filtering-with-the-like-clause.js +36 -0
  75. package/esm/docs/en/docs/create-metrics/maql/filters/filtering-with-the-where-clause.d.ts +2 -0
  76. package/esm/docs/en/docs/create-metrics/maql/filters/filtering-with-the-where-clause.d.ts.map +1 -0
  77. package/esm/docs/en/docs/create-metrics/maql/filters/filtering-with-the-where-clause.js +36 -0
  78. package/esm/docs/en/docs/create-metrics/maql/filters/overriding-attribute-filters/by-all-in-all-other-dimensions-except-for-attribute.d.ts +2 -0
  79. package/esm/docs/en/docs/create-metrics/maql/filters/overriding-attribute-filters/by-all-in-all-other-dimensions-except-for-attribute.d.ts.map +1 -0
  80. package/esm/docs/en/docs/create-metrics/maql/filters/overriding-attribute-filters/by-all-in-all-other-dimensions-except-for-attribute.js +21 -0
  81. package/esm/docs/en/docs/create-metrics/maql/filters/overriding-attribute-filters/by-all-in-all-other-dimensions.d.ts +2 -0
  82. package/esm/docs/en/docs/create-metrics/maql/filters/overriding-attribute-filters/by-all-in-all-other-dimensions.d.ts.map +1 -0
  83. package/esm/docs/en/docs/create-metrics/maql/filters/overriding-attribute-filters/by-all-in-all-other-dimensions.js +27 -0
  84. package/esm/docs/en/docs/create-metrics/maql/filters/overriding-attribute-filters/by-all.d.ts +2 -0
  85. package/esm/docs/en/docs/create-metrics/maql/filters/overriding-attribute-filters/by-all.d.ts.map +1 -0
  86. package/esm/docs/en/docs/create-metrics/maql/filters/overriding-attribute-filters/by-all.js +64 -0
  87. package/esm/docs/en/docs/create-metrics/maql/filters/overriding-attribute-filters/by-attribute-all-in-all-other-dimensions.d.ts +2 -0
  88. package/esm/docs/en/docs/create-metrics/maql/filters/overriding-attribute-filters/by-attribute-all-in-all-other-dimensions.d.ts.map +1 -0
  89. package/esm/docs/en/docs/create-metrics/maql/filters/overriding-attribute-filters/by-attribute-all-in-all-other-dimensions.js +22 -0
  90. package/esm/docs/en/docs/create-metrics/maql/filters/overriding-attribute-filters/by.d.ts +2 -0
  91. package/esm/docs/en/docs/create-metrics/maql/filters/overriding-attribute-filters/by.d.ts.map +1 -0
  92. package/esm/docs/en/docs/create-metrics/maql/filters/overriding-attribute-filters/by.js +85 -0
  93. package/esm/docs/en/docs/create-metrics/maql/filters/overriding-parent/with-parent-except.d.ts +2 -0
  94. package/esm/docs/en/docs/create-metrics/maql/filters/overriding-parent/with-parent-except.d.ts.map +1 -0
  95. package/esm/docs/en/docs/create-metrics/maql/filters/overriding-parent/with-parent-except.js +37 -0
  96. package/esm/docs/en/docs/create-metrics/maql/filters/overriding-parent/with-parent-filter.d.ts +2 -0
  97. package/esm/docs/en/docs/create-metrics/maql/filters/overriding-parent/with-parent-filter.d.ts.map +1 -0
  98. package/esm/docs/en/docs/create-metrics/maql/filters/overriding-parent/with-parent-filter.js +42 -0
  99. package/esm/docs/en/docs/create-metrics/maql/filters/overriding-parent/without-parent-except.d.ts +2 -0
  100. package/esm/docs/en/docs/create-metrics/maql/filters/overriding-parent/without-parent-except.d.ts.map +1 -0
  101. package/esm/docs/en/docs/create-metrics/maql/filters/overriding-parent/without-parent-except.js +94 -0
  102. package/esm/docs/en/docs/create-metrics/maql/filters/overriding-parent/without-parent-filter.d.ts +2 -0
  103. package/esm/docs/en/docs/create-metrics/maql/filters/overriding-parent/without-parent-filter.d.ts.map +1 -0
  104. package/esm/docs/en/docs/create-metrics/maql/filters/overriding-parent/without-parent-filter.js +33 -0
  105. package/esm/docs/en/docs/create-metrics/maql/for-each.d.ts +2 -0
  106. package/esm/docs/en/docs/create-metrics/maql/for-each.d.ts.map +1 -0
  107. package/esm/docs/en/docs/create-metrics/maql/for-each.js +17 -0
  108. package/esm/docs/en/docs/create-metrics/maql/logical-operators/and.d.ts +2 -0
  109. package/esm/docs/en/docs/create-metrics/maql/logical-operators/and.d.ts.map +1 -0
  110. package/esm/docs/en/docs/create-metrics/maql/logical-operators/and.js +37 -0
  111. package/esm/docs/en/docs/create-metrics/maql/logical-operators/not.d.ts +2 -0
  112. package/esm/docs/en/docs/create-metrics/maql/logical-operators/not.d.ts.map +1 -0
  113. package/esm/docs/en/docs/create-metrics/maql/logical-operators/not.js +12 -0
  114. package/esm/docs/en/docs/create-metrics/maql/logical-operators/or.d.ts +2 -0
  115. package/esm/docs/en/docs/create-metrics/maql/logical-operators/or.d.ts.map +1 -0
  116. package/esm/docs/en/docs/create-metrics/maql/logical-operators/or.js +22 -0
  117. package/esm/docs/en/docs/create-metrics/maql/maql-and-multidimensionality.d.ts +2 -0
  118. package/esm/docs/en/docs/create-metrics/maql/maql-and-multidimensionality.d.ts.map +1 -0
  119. package/esm/docs/en/docs/create-metrics/maql/maql-and-multidimensionality.js +59 -0
  120. package/esm/docs/en/docs/create-metrics/maql/math/abs.d.ts +2 -0
  121. package/esm/docs/en/docs/create-metrics/maql/math/abs.d.ts.map +1 -0
  122. package/esm/docs/en/docs/create-metrics/maql/math/abs.js +23 -0
  123. package/esm/docs/en/docs/create-metrics/maql/math/arithmetic-operations.d.ts +2 -0
  124. package/esm/docs/en/docs/create-metrics/maql/math/arithmetic-operations.d.ts.map +1 -0
  125. package/esm/docs/en/docs/create-metrics/maql/math/arithmetic-operations.js +29 -0
  126. package/esm/docs/en/docs/create-metrics/maql/math/ceiling.d.ts +2 -0
  127. package/esm/docs/en/docs/create-metrics/maql/math/ceiling.d.ts.map +1 -0
  128. package/esm/docs/en/docs/create-metrics/maql/math/ceiling.js +21 -0
  129. package/esm/docs/en/docs/create-metrics/maql/math/exp.d.ts +2 -0
  130. package/esm/docs/en/docs/create-metrics/maql/math/exp.d.ts.map +1 -0
  131. package/esm/docs/en/docs/create-metrics/maql/math/exp.js +27 -0
  132. package/esm/docs/en/docs/create-metrics/maql/math/floor.d.ts +2 -0
  133. package/esm/docs/en/docs/create-metrics/maql/math/floor.d.ts.map +1 -0
  134. package/esm/docs/en/docs/create-metrics/maql/math/floor.js +21 -0
  135. package/esm/docs/en/docs/create-metrics/maql/math/greatest.d.ts +2 -0
  136. package/esm/docs/en/docs/create-metrics/maql/math/greatest.d.ts.map +1 -0
  137. package/esm/docs/en/docs/create-metrics/maql/math/greatest.js +13 -0
  138. package/esm/docs/en/docs/create-metrics/maql/math/least.d.ts +2 -0
  139. package/esm/docs/en/docs/create-metrics/maql/math/least.d.ts.map +1 -0
  140. package/esm/docs/en/docs/create-metrics/maql/math/least.js +13 -0
  141. package/esm/docs/en/docs/create-metrics/maql/math/ln.d.ts +2 -0
  142. package/esm/docs/en/docs/create-metrics/maql/math/ln.d.ts.map +1 -0
  143. package/esm/docs/en/docs/create-metrics/maql/math/ln.js +33 -0
  144. package/esm/docs/en/docs/create-metrics/maql/math/log.d.ts +2 -0
  145. package/esm/docs/en/docs/create-metrics/maql/math/log.d.ts.map +1 -0
  146. package/esm/docs/en/docs/create-metrics/maql/math/log.js +29 -0
  147. package/esm/docs/en/docs/create-metrics/maql/math/power.d.ts +2 -0
  148. package/esm/docs/en/docs/create-metrics/maql/math/power.d.ts.map +1 -0
  149. package/esm/docs/en/docs/create-metrics/maql/math/power.js +33 -0
  150. package/esm/docs/en/docs/create-metrics/maql/math/round.d.ts +2 -0
  151. package/esm/docs/en/docs/create-metrics/maql/math/round.d.ts.map +1 -0
  152. package/esm/docs/en/docs/create-metrics/maql/math/round.js +34 -0
  153. package/esm/docs/en/docs/create-metrics/maql/math/sign.d.ts +2 -0
  154. package/esm/docs/en/docs/create-metrics/maql/math/sign.d.ts.map +1 -0
  155. package/esm/docs/en/docs/create-metrics/maql/math/sign.js +30 -0
  156. package/esm/docs/en/docs/create-metrics/maql/math/sqrt.d.ts +2 -0
  157. package/esm/docs/en/docs/create-metrics/maql/math/sqrt.d.ts.map +1 -0
  158. package/esm/docs/en/docs/create-metrics/maql/math/sqrt.js +32 -0
  159. package/esm/docs/en/docs/create-metrics/maql/math/trunc.d.ts +2 -0
  160. package/esm/docs/en/docs/create-metrics/maql/math/trunc.d.ts.map +1 -0
  161. package/esm/docs/en/docs/create-metrics/maql/math/trunc.js +36 -0
  162. package/esm/docs/en/docs/create-metrics/maql/ranking/percentile.d.ts +2 -0
  163. package/esm/docs/en/docs/create-metrics/maql/ranking/percentile.d.ts.map +1 -0
  164. package/esm/docs/en/docs/create-metrics/maql/ranking/percentile.js +57 -0
  165. package/esm/docs/en/docs/create-metrics/maql/ranking/rank-variations.d.ts +2 -0
  166. package/esm/docs/en/docs/create-metrics/maql/ranking/rank-variations.d.ts.map +1 -0
  167. package/esm/docs/en/docs/create-metrics/maql/ranking/rank-variations.js +90 -0
  168. package/esm/docs/en/docs/create-metrics/maql/ranking/where-top-or-bottom-in.d.ts +2 -0
  169. package/esm/docs/en/docs/create-metrics/maql/ranking/where-top-or-bottom-in.d.ts.map +1 -0
  170. package/esm/docs/en/docs/create-metrics/maql/ranking/where-top-or-bottom-in.js +53 -0
  171. package/esm/docs/en/docs/create-metrics/maql/ranking/where-top-or-bottom-of.d.ts +2 -0
  172. package/esm/docs/en/docs/create-metrics/maql/ranking/where-top-or-bottom-of.d.ts.map +1 -0
  173. package/esm/docs/en/docs/create-metrics/maql/ranking/where-top-or-bottom-of.js +29 -0
  174. package/esm/docs/en/docs/create-metrics/maql/ranking/within-clause.d.ts +2 -0
  175. package/esm/docs/en/docs/create-metrics/maql/ranking/within-clause.d.ts.map +1 -0
  176. package/esm/docs/en/docs/create-metrics/maql/ranking/within-clause.js +101 -0
  177. package/esm/docs/en/docs/create-metrics/maql/relational-operators.d.ts +2 -0
  178. package/esm/docs/en/docs/create-metrics/maql/relational-operators.d.ts.map +1 -0
  179. package/esm/docs/en/docs/create-metrics/maql/relational-operators.js +50 -0
  180. package/esm/docs/en/docs/create-metrics/maql/runing-totals/rolling-window.d.ts +2 -0
  181. package/esm/docs/en/docs/create-metrics/maql/runing-totals/rolling-window.d.ts.map +1 -0
  182. package/esm/docs/en/docs/create-metrics/maql/runing-totals/rolling-window.js +71 -0
  183. package/esm/docs/en/docs/create-metrics/maql/runing-totals/running-total-statistical-functions.d.ts +2 -0
  184. package/esm/docs/en/docs/create-metrics/maql/runing-totals/running-total-statistical-functions.d.ts.map +1 -0
  185. package/esm/docs/en/docs/create-metrics/maql/runing-totals/running-total-statistical-functions.js +54 -0
  186. package/esm/docs/en/docs/create-metrics/maql/runing-totals/running-totals-for-core-functions.d.ts +2 -0
  187. package/esm/docs/en/docs/create-metrics/maql/runing-totals/running-totals-for-core-functions.d.ts.map +1 -0
  188. package/esm/docs/en/docs/create-metrics/maql/runing-totals/running-totals-for-core-functions.js +37 -0
  189. package/esm/docs/en/docs/create-metrics/maql/statistic/correl.d.ts +2 -0
  190. package/esm/docs/en/docs/create-metrics/maql/statistic/correl.d.ts.map +1 -0
  191. package/esm/docs/en/docs/create-metrics/maql/statistic/correl.js +47 -0
  192. package/esm/docs/en/docs/create-metrics/maql/statistic/covariance-functions.d.ts +2 -0
  193. package/esm/docs/en/docs/create-metrics/maql/statistic/covariance-functions.d.ts.map +1 -0
  194. package/esm/docs/en/docs/create-metrics/maql/statistic/covariance-functions.js +46 -0
  195. package/esm/docs/en/docs/create-metrics/maql/statistic/forecast.d.ts +2 -0
  196. package/esm/docs/en/docs/create-metrics/maql/statistic/forecast.d.ts.map +1 -0
  197. package/esm/docs/en/docs/create-metrics/maql/statistic/forecast.js +74 -0
  198. package/esm/docs/en/docs/create-metrics/maql/statistic/least-squares-functions.d.ts +2 -0
  199. package/esm/docs/en/docs/create-metrics/maql/statistic/least-squares-functions.d.ts.map +1 -0
  200. package/esm/docs/en/docs/create-metrics/maql/statistic/least-squares-functions.js +44 -0
  201. package/esm/docs/en/docs/create-metrics/maql/statistic/standard-deviation-functions.d.ts +2 -0
  202. package/esm/docs/en/docs/create-metrics/maql/statistic/standard-deviation-functions.d.ts.map +1 -0
  203. package/esm/docs/en/docs/create-metrics/maql/statistic/standard-deviation-functions.js +88 -0
  204. package/esm/docs/en/docs/create-metrics/maql/statistic/variance-functions.d.ts +2 -0
  205. package/esm/docs/en/docs/create-metrics/maql/statistic/variance-functions.d.ts.map +1 -0
  206. package/esm/docs/en/docs/create-metrics/maql/statistic/variance-functions.js +54 -0
  207. package/esm/docs/en/docs/create-metrics/maql/time/for-each.d.ts +2 -0
  208. package/esm/docs/en/docs/create-metrics/maql/time/for-each.d.ts.map +1 -0
  209. package/esm/docs/en/docs/create-metrics/maql/time/for-each.js +96 -0
  210. package/esm/docs/en/docs/create-metrics/maql/time/for-next-period.d.ts +2 -0
  211. package/esm/docs/en/docs/create-metrics/maql/time/for-next-period.d.ts.map +1 -0
  212. package/esm/docs/en/docs/create-metrics/maql/time/for-next-period.js +38 -0
  213. package/esm/docs/en/docs/create-metrics/maql/time/for-next.d.ts +2 -0
  214. package/esm/docs/en/docs/create-metrics/maql/time/for-next.d.ts.map +1 -0
  215. package/esm/docs/en/docs/create-metrics/maql/time/for-next.js +27 -0
  216. package/esm/docs/en/docs/create-metrics/maql/time/for-previous-period.d.ts +2 -0
  217. package/esm/docs/en/docs/create-metrics/maql/time/for-previous-period.d.ts.map +1 -0
  218. package/esm/docs/en/docs/create-metrics/maql/time/for-previous-period.js +26 -0
  219. package/esm/docs/en/docs/create-metrics/maql/time/for-previous.d.ts +2 -0
  220. package/esm/docs/en/docs/create-metrics/maql/time/for-previous.d.ts.map +1 -0
  221. package/esm/docs/en/docs/create-metrics/maql/time/for-previous.js +30 -0
  222. package/esm/docs/en/docs/create-metrics/maql/time/functions-for-referring-to-past-time-periods.d.ts +2 -0
  223. package/esm/docs/en/docs/create-metrics/maql/time/functions-for-referring-to-past-time-periods.d.ts.map +1 -0
  224. package/esm/docs/en/docs/create-metrics/maql/time/functions-for-referring-to-past-time-periods.js +36 -0
  225. package/esm/docs/en/docs/create-metrics/maql/time-arithmetics/datetime-add.d.ts +2 -0
  226. package/esm/docs/en/docs/create-metrics/maql/time-arithmetics/datetime-add.d.ts.map +1 -0
  227. package/esm/docs/en/docs/create-metrics/maql/time-arithmetics/datetime-add.js +53 -0
  228. package/esm/docs/en/docs/create-metrics/maql/time-arithmetics/datetime-diff.d.ts +2 -0
  229. package/esm/docs/en/docs/create-metrics/maql/time-arithmetics/datetime-diff.d.ts.map +1 -0
  230. package/esm/docs/en/docs/create-metrics/maql/time-arithmetics/datetime-diff.js +55 -0
  231. package/esm/docs/en/docs/create-metrics/maql/time-macros.d.ts +2 -0
  232. package/esm/docs/en/docs/create-metrics/maql/time-macros.d.ts.map +1 -0
  233. package/esm/docs/en/docs/create-metrics/maql/time-macros.js +79 -0
  234. package/esm/docs/index.d.ts +82 -0
  235. package/esm/docs/index.d.ts.map +1 -0
  236. package/esm/docs/index.js +143 -0
  237. package/esm/findObjects.d.ts +13 -0
  238. package/esm/findObjects.d.ts.map +1 -0
  239. package/esm/findObjects.js +73 -0
  240. package/esm/format.d.ts +4 -0
  241. package/esm/format.d.ts.map +1 -0
  242. package/esm/format.js +569 -0
  243. package/esm/highlight/convert.d.ts +3 -0
  244. package/esm/highlight/convert.d.ts.map +1 -0
  245. package/esm/highlight/convert.js +12 -0
  246. package/esm/highlight/semanticsHighlight.d.ts +47 -0
  247. package/esm/highlight/semanticsHighlight.d.ts.map +1 -0
  248. package/esm/highlight/semanticsHighlight.js +345 -0
  249. package/esm/highlight/utils.d.ts +3 -0
  250. package/esm/highlight/utils.d.ts.map +1 -0
  251. package/esm/highlight/utils.js +14 -0
  252. package/esm/hover.d.ts +23 -0
  253. package/esm/hover.d.ts.map +1 -0
  254. package/esm/hover.js +60 -0
  255. package/esm/index.d.ts +11 -0
  256. package/esm/index.d.ts.map +1 -0
  257. package/esm/index.js +9 -0
  258. package/esm/labelElements.d.ts +22 -0
  259. package/esm/labelElements.d.ts.map +1 -0
  260. package/esm/labelElements.js +224 -0
  261. package/esm/maqlLanguageService.d.ts +56 -0
  262. package/esm/maqlLanguageService.d.ts.map +1 -0
  263. package/esm/maqlLanguageService.js +104 -0
  264. package/esm/maqlObjectTypes.d.ts +17 -0
  265. package/esm/maqlObjectTypes.d.ts.map +1 -0
  266. package/esm/maqlObjectTypes.js +30 -0
  267. package/esm/maqlServer.d.ts +4 -0
  268. package/esm/maqlServer.d.ts.map +1 -0
  269. package/esm/maqlServer.js +78 -0
  270. package/esm/metadata/model.d.ts +162 -0
  271. package/esm/metadata/model.d.ts.map +1 -0
  272. package/esm/metadata/model.js +143 -0
  273. package/esm/metadata/parameters.d.ts +16 -0
  274. package/esm/metadata/parameters.d.ts.map +1 -0
  275. package/esm/metadata/parameters.js +37 -0
  276. package/esm/metadata/types.d.ts +16 -0
  277. package/esm/metadata/types.d.ts.map +1 -0
  278. package/esm/metadata/types.js +2 -0
  279. package/esm/metadataService.d.ts +56 -0
  280. package/esm/metadataService.d.ts.map +1 -0
  281. package/esm/metadataService.js +159 -0
  282. package/esm/node/main.d.ts +2 -0
  283. package/esm/node/main.d.ts.map +1 -0
  284. package/esm/node/main.js +18 -0
  285. package/esm/parameterConstraints.d.ts +5 -0
  286. package/esm/parameterConstraints.d.ts.map +1 -0
  287. package/esm/parameterConstraints.js +197 -0
  288. package/esm/parseMaql.d.ts +43 -0
  289. package/esm/parseMaql.d.ts.map +1 -0
  290. package/esm/parseMaql.js +96 -0
  291. package/esm/renderParameters.d.ts +41 -0
  292. package/esm/renderParameters.d.ts.map +1 -0
  293. package/esm/renderParameters.js +76 -0
  294. package/esm/sdk-maql-language-server.d.ts +496 -0
  295. package/esm/tests/metadata.test.helpers.d.ts +8 -0
  296. package/esm/tests/metadata.test.helpers.d.ts.map +1 -0
  297. package/esm/tests/metadata.test.helpers.js +468 -0
  298. package/esm/tokenRanges.d.ts +36 -0
  299. package/esm/tokenRanges.d.ts.map +1 -0
  300. package/esm/tokenRanges.js +55 -0
  301. package/esm/tsdoc-metadata.json +11 -0
  302. package/esm/types/hierarchy.d.ts +37 -0
  303. package/esm/types/hierarchy.d.ts.map +1 -0
  304. package/esm/types/hierarchy.js +165 -0
  305. package/esm/types/signatures.d.ts +40 -0
  306. package/esm/types/signatures.d.ts.map +1 -0
  307. package/esm/types/signatures.js +141 -0
  308. package/esm/types/typeChecking.d.ts +54 -0
  309. package/esm/types/typeChecking.d.ts.map +1 -0
  310. package/esm/types/typeChecking.js +295 -0
  311. package/esm/types/typeModel.d.ts +18 -0
  312. package/esm/types/typeModel.d.ts.map +1 -0
  313. package/esm/types/typeModel.js +84 -0
  314. package/package.json +83 -3
@@ -0,0 +1,88 @@
1
+ // (C) 2021-2026 GoodData Corporation
2
+ export const content = `# Standard Deviation Functions
3
+ Standard deviation function return the statistical standard deviation of
4
+ all values in the set based on a sample of the population (STDEV), or
5
+ based on a biased population (STDEVP).
6
+
7
+ Standard deviation is useful for measuring variance within a data set
8
+ and, in application, confidence in statistical results. For example, in
9
+ finance, standard deviation can measure the potential deviation from
10
+ expected return rate, measuring the volatility of the investment.
11
+ Depending on the number of values in the sample set, you should use
12
+ either of the following metrics.
13
+
14
+ - \`STDEV (*numeric*)\`, also known as the **corrected standard deviation**
15
+
16
+ ![Equation - Standard Deviation](https://www.gooddata.com/developers/cloud-native/doc/maql/stdev.png)
17
+ - where *numeric* is a fact or metric
18
+ - Computes the sum of squared differences from the mean for *n*
19
+ values divided by a sample size factor. If the input values are
20
+ a sample of the total (biased) population, the divisor is *(n -
21
+ 1)* sample size, which is used in the STDEV function.
22
+
23
+ - This value is the **variance**. See [Variance Functions](https://www.gooddata.com/developers/cloud-native/doc/hosted/create-metrics/maql/statistic/variance-functions/). The square root of the above value represents the standard deviation.
24
+
25
+ If individual values are used as inputs, STDEV, generates a null
26
+ value. In these cases, use STDEVP instead.
27
+
28
+ - \`STDEVP (*numeric*)\`, also known as the **uncorrected standard deviation**.
29
+
30
+ ![Equation - Standard Deviation for Populations](https://www.gooddata.com/developers/cloud-native/doc/maql/stdevp.png )
31
+
32
+ - where *numeric* is a fact or metric
33
+ - Computes square root of the sum of squared differences from the mean for *n* values divided by *n*
34
+ - Use STDEVP for calculating standard deviations if the input set
35
+ contains the entire (unbiased) population of values. The
36
+ deviation for a single value is zero.
37
+
38
+ ## Syntax
39
+
40
+ \`\`\`
41
+ SELECT STDEV(…)
42
+ SELECT STDEV(metric)
43
+ SELECT STDEVP(fact)
44
+ \`\`\`
45
+
46
+ ## Examples
47
+
48
+ \`\`\`
49
+ SELECT STDEV({metric/internal_rate_of_return})
50
+ SELECT STDEVP({metric/gross_weight})
51
+ \`\`\`
52
+
53
+ ## Using Standard Deviation
54
+
55
+ You can use standard deviation to create ranges as other metrics.
56
+ Suppose you have a standard deviation metric (StDev Transaction Amt):
57
+
58
+ ### Example 1: +1 Std.
59
+
60
+ \`\`\`
61
+ SELECT {metric/avg_transaction_amt} + {metric/stdev_transaction_amt}
62
+ \`\`\`
63
+
64
+ ### Example 2: +2 Std.
65
+
66
+ \`\`\`
67
+ SELECT {metric/avg_transaction_amt} + ({metric/stdev_transaction_amt} * 2)
68
+ \`\`\`
69
+
70
+ ### Example 3: -1 Std.
71
+
72
+ \`\`\`
73
+ SELECT {metric/avg_transaction_amt} + ({metric/stdev_transaction_amt} * -1)
74
+ \`\`\`
75
+
76
+ ### Example 4: -2 Std.
77
+
78
+ \`\`\`
79
+ SELECT {metric/avg_transaction_amt} + ({metric/stdev_transaction_amt} * -2)
80
+ \`\`\`
81
+
82
+ ### Sample Chart
83
+
84
+ Using the examples above, you can create a combo chart that shows all
85
+ individual transactions (X axis) and where they fall within bands of
86
+ +2/-2 standard deviations (Y axis).
87
+
88
+ ![Transaction amounts compared to standard deviations](https://www.gooddata.com/developers/cloud-native/doc/maql/stdev-transaction-accounts.png)`;
@@ -0,0 +1,2 @@
1
+ export declare const content = "# Variance Functions\nReturns the statistical variance - how far a set of values is spread out based on a sample of the population (VAR), or based on a biased population (VARP). Variance is non-negative, zero indicates that all values are identical.\n\nVariance computation is used to build standard deviation and other statistical functions.\n\nTo measure spread, variance calculates the mean of all values in the\nsample. For each input value in the set, the difference of the value\nfrom the mean is computed, and this difference is squared. All of the\nsquares are added together, and then divided by a sample size factor,\ndepending on the function you are using.\n\n- Values for variance are non-negative. A value of 0 indicates that\n there is no variance among the values; all values are identical.\n- The square root of variance is the standard deviation. See [Standard Deviation Functions](https://www.gooddata.com/developers/cloud-native/doc/hosted/create-metrics/maql/statistic/standard-deviation-functions/).\n- Covariance measures how two sets of values change together. See\n [Covariance Functions](https://www.gooddata.com/developers/cloud-native/doc/hosted/create-metrics/maql/statistic/covariance-functions/).\n\nThe spread is measured for a sample of the (biased) population (VAR) or\nfor the entire (unbiased) population (VARP).\n\n- For a sample of the population, use the VAR function, which divides\n the sum of squares by the number of values in the same size (N-1):\n\n ![Equation - Variance](https://www.gooddata.com/developers/cloud-native/doc/maql/var.png)\n - `VAR (*numeric*)`\n - where *numeric* is a fact or metric\n - Computes the sum of squared differences from the mean for\n *n* values divided by *n-1*\n\n- If the set of values is the entire population of values, use the\n VARP function, which divides the sum of squares by N:\n\n ![Equation - Variance for Populations](https://www.gooddata.com/developers/cloud-native/doc/maql/var.png)\n\n - `VARP (*numeric*)``\n - where *numeric* is a fact or metric\n - Computes the sum of squared differences from the mean for\n *n* values divided by *n*]\n\n## Syntax\n\n```\nSELECT VAR(\u2026)\nSELECT VAR(metric)\nSELECT VARP(fact)\n```\n\n## Examples\n\n```\nSELECT VAR({metric/internal_rate_of_return})\nSELECT VARP({metric/gross_weight})\n```";
2
+ //# sourceMappingURL=variance-functions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variance-functions.d.ts","sourceRoot":"","sources":["../../../../../../../src/docs/en/docs/create-metrics/maql/statistic/variance-functions.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,y3EAoDb,CAAC"}
@@ -0,0 +1,54 @@
1
+ // (C) 2021-2026 GoodData Corporation
2
+ export const content = `# Variance Functions
3
+ Returns the statistical variance - how far a set of values is spread out based on a sample of the population (VAR), or based on a biased population (VARP). Variance is non-negative, zero indicates that all values are identical.
4
+
5
+ Variance computation is used to build standard deviation and other statistical functions.
6
+
7
+ To measure spread, variance calculates the mean of all values in the
8
+ sample. For each input value in the set, the difference of the value
9
+ from the mean is computed, and this difference is squared. All of the
10
+ squares are added together, and then divided by a sample size factor,
11
+ depending on the function you are using.
12
+
13
+ - Values for variance are non-negative. A value of 0 indicates that
14
+ there is no variance among the values; all values are identical.
15
+ - The square root of variance is the standard deviation. See [Standard Deviation Functions](https://www.gooddata.com/developers/cloud-native/doc/hosted/create-metrics/maql/statistic/standard-deviation-functions/).
16
+ - Covariance measures how two sets of values change together. See
17
+ [Covariance Functions](https://www.gooddata.com/developers/cloud-native/doc/hosted/create-metrics/maql/statistic/covariance-functions/).
18
+
19
+ The spread is measured for a sample of the (biased) population (VAR) or
20
+ for the entire (unbiased) population (VARP).
21
+
22
+ - For a sample of the population, use the VAR function, which divides
23
+ the sum of squares by the number of values in the same size (N-1):
24
+
25
+ ![Equation - Variance](https://www.gooddata.com/developers/cloud-native/doc/maql/var.png)
26
+ - \`VAR (*numeric*)\`
27
+ - where *numeric* is a fact or metric
28
+ - Computes the sum of squared differences from the mean for
29
+ *n* values divided by *n-1*
30
+
31
+ - If the set of values is the entire population of values, use the
32
+ VARP function, which divides the sum of squares by N:
33
+
34
+ ![Equation - Variance for Populations](https://www.gooddata.com/developers/cloud-native/doc/maql/var.png)
35
+
36
+ - \`VARP (*numeric*)\`\`
37
+ - where *numeric* is a fact or metric
38
+ - Computes the sum of squared differences from the mean for
39
+ *n* values divided by *n*\]
40
+
41
+ ## Syntax
42
+
43
+ \`\`\`
44
+ SELECT VAR(…)
45
+ SELECT VAR(metric)
46
+ SELECT VARP(fact)
47
+ \`\`\`
48
+
49
+ ## Examples
50
+
51
+ \`\`\`
52
+ SELECT VAR({metric/internal_rate_of_return})
53
+ SELECT VARP({metric/gross_weight})
54
+ \`\`\``;
@@ -0,0 +1,2 @@
1
+ export declare const content = "# FOR EACH\nThe **FOR EACH** clause allows you to display all attribute values in your visualization, even if they are missing.\n\nIf you want to display how many visits are planned for each particular month, the visualization normally shows you all months with at least one visit planned.\n\n![Table](https://www.gooddata.com/developers/cloud-native/doc/maql/outerjoins02.png)\n\nIf you use the **FOR EACH** for month of the year, the visualization will show you also the months that have no visits planned. \n\n![FOR Each in Metric](https://www.gooddata.com/developers/cloud-native/doc/maql/outerjoins01.png)\n\nWhen creating metrics with `FOR EACH`, remember that:\n\n* The visualizations in Analytical Designer must be sliced with the same attributes that are used in the `FOR EACH` clauses to display the missing values. Otherwise, `FOR EACH` is ignored.\n\n* If the visualization contains multiple metrics with `FOR EACH` applied, the visualization displays all attribute values. \n\n* When `FOR EACH` is applied, the visualization displays all attribute values between the first and the last metric values available. \n \n ![Metrics in Separate Visualizations](https://www.gooddata.com/developers/cloud-native/doc/maql/outerjoins04.png)\n\n If the visualization contains multiple metrics, it displays attribute values from all metrics.\n\n ![Metrics in One Visualizations](https://www.gooddata.com/developers/cloud-native/doc/maql/outerjoins05.png)\n\nYou can also select the **show all values** option in your visualizations in Analytical Designer to display similar results. For details, see [FOR EACH versus Show All Values](https://www.gooddata.com/developers/cloud-native/doc/hosted/create-metrics/maql/time/for-each/#for-each-versus-show-all-values) and [Create Visualizations](https://www.gooddata.com/developers/cloud-native/doc/hosted/create-visualizations/).\n\n#### Day versus Day of Week\n\nWhen With date attributes, the `FOR EACH` clause displays the following:\n\n* For `month` and similar, the `FOR EACH` clause displays attribute values from the first to the last metric values available, including the missing values in between.\n ![Month](https://www.gooddata.com/developers/cloud-native/doc/maql/outerjoins06.png)\n\n* For `month of year` and similar date attributes, the `FOR EACH` clause display always all attribute values.\n ![Month of Year](https://www.gooddata.com/developers/cloud-native/doc/maql/outerjoins07.png)\n\n\n\n#### FOR EACH versus Show All Values\n\nThe `FOR EACH` clause and the `Show all values` option in Analytical Designer show similar results.\n\n* `FOR EACH` displays attribute values between the first and the last metric values of each metric, including the missing values in between. \n\n If any attribute value falls outside of such intervals for all metrics, it is not displayed.\n\n ![Metrics in Separate Visualizations](https://www.gooddata.com/developers/cloud-native/doc/maql/outerjoins08.png)\n\n* `Show all values` displays all attribute values regardless of the metric values available.\n\n ![Metrics in Separate Visualizations](https://www.gooddata.com/developers/cloud-native/doc/maql/outerjoins09.png)\n\n\n\n## Syntax\n\n```\nSELECT ... BY ... FOR EACH (attribute/label), (attribute/label), ...\n```\n\n## Examples\n\nDisplay the sum for all sold items every month. The `FOR EACH` clause displays also items and months with no sale.\n```\nSELECT SUM(fact/sales) FOR EACH (attribute/saledate.month), (attribute/item)\n```\n\nDisplay the moving average. The `FOR EACH` clause displays also the days without any change.\n```\nSELECT RUNAVG({metric/value}) ROWS BETWEEN 6 PRECEDING AND CURRENT ROW FOR EACH(date.day)\n```\n\nDisplay the moving average. The `FOR EACH` clause displays also the days without any change and shows missing values as zeros. \n```\nSELECT RUNAVG( IFNULL({metric/value},0)) ROWS BETWEEN 6 PRECEDING AND CURRENT ROW FOR EACH(date.day)\n```\n\nDisplay the bottom 10 products with the lowest number of orders. The `FOR EACH` clause counts also the products with no orders.\n```\nSELECT COUNT({label/order_id}) FOR EACH {label/product_name} WHERE BOTTOM(10) OF (COUNT({label/order_id}) )\n```\n\n## Data Source Support for Dates\n\nSome of the data sources may not fully support FOR EACH with **date attributes**:\n\n* *Dremio*, *Drill*, *Redshift*, and *Synapse* do not support FOR EACH for date attributes.\n\n* *SQL Server 2022 (16.x)*, *Azure SQL Database* and *Azure SQL Managed Instance* support date attributes only from the compatibility level 160.\n\nOther data sources fully support FOR EACH for all attributes.\n\nYou can create metrics with FOR EACH even if your data source does not support it. If you add such metric to a visualization, Analytical Designer will display an error.\n{{% /alert %}}";
2
+ //# sourceMappingURL=for-each.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"for-each.d.ts","sourceRoot":"","sources":["../../../../../../../src/docs/en/docs/create-metrics/maql/time/for-each.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,8tJA8FL,CAAC"}
@@ -0,0 +1,96 @@
1
+ // (C) 2021-2026 GoodData Corporation
2
+ export const content = `# FOR EACH
3
+ The **FOR EACH** clause allows you to display all attribute values in your visualization, even if they are missing.
4
+
5
+ If you want to display how many visits are planned for each particular month, the visualization normally shows you all months with at least one visit planned.
6
+
7
+ ![Table](https://www.gooddata.com/developers/cloud-native/doc/maql/outerjoins02.png)
8
+
9
+ If you use the **FOR EACH** for month of the year, the visualization will show you also the months that have no visits planned.
10
+
11
+ ![FOR Each in Metric](https://www.gooddata.com/developers/cloud-native/doc/maql/outerjoins01.png)
12
+
13
+ When creating metrics with \`FOR EACH\`, remember that:
14
+
15
+ * The visualizations in Analytical Designer must be sliced with the same attributes that are used in the \`FOR EACH\` clauses to display the missing values. Otherwise, \`FOR EACH\` is ignored.
16
+
17
+ * If the visualization contains multiple metrics with \`FOR EACH\` applied, the visualization displays all attribute values.
18
+
19
+ * When \`FOR EACH\` is applied, the visualization displays all attribute values between the first and the last metric values available.
20
+
21
+ ![Metrics in Separate Visualizations](https://www.gooddata.com/developers/cloud-native/doc/maql/outerjoins04.png)
22
+
23
+ If the visualization contains multiple metrics, it displays attribute values from all metrics.
24
+
25
+ ![Metrics in One Visualizations](https://www.gooddata.com/developers/cloud-native/doc/maql/outerjoins05.png)
26
+
27
+ You can also select the **show all values** option in your visualizations in Analytical Designer to display similar results. For details, see [FOR EACH versus Show All Values](https://www.gooddata.com/developers/cloud-native/doc/hosted/create-metrics/maql/time/for-each/#for-each-versus-show-all-values) and [Create Visualizations](https://www.gooddata.com/developers/cloud-native/doc/hosted/create-visualizations/).
28
+
29
+ #### Day versus Day of Week
30
+
31
+ When With date attributes, the \`FOR EACH\` clause displays the following:
32
+
33
+ * For \`month\` and similar, the \`FOR EACH\` clause displays attribute values from the first to the last metric values available, including the missing values in between.
34
+ ![Month](https://www.gooddata.com/developers/cloud-native/doc/maql/outerjoins06.png)
35
+
36
+ * For \`month of year\` and similar date attributes, the \`FOR EACH\` clause display always all attribute values.
37
+ ![Month of Year](https://www.gooddata.com/developers/cloud-native/doc/maql/outerjoins07.png)
38
+
39
+
40
+
41
+ #### FOR EACH versus Show All Values
42
+
43
+ The \`FOR EACH\` clause and the \`Show all values\` option in Analytical Designer show similar results.
44
+
45
+ * \`FOR EACH\` displays attribute values between the first and the last metric values of each metric, including the missing values in between.
46
+
47
+ If any attribute value falls outside of such intervals for all metrics, it is not displayed.
48
+
49
+ ![Metrics in Separate Visualizations](https://www.gooddata.com/developers/cloud-native/doc/maql/outerjoins08.png)
50
+
51
+ * \`Show all values\` displays all attribute values regardless of the metric values available.
52
+
53
+ ![Metrics in Separate Visualizations](https://www.gooddata.com/developers/cloud-native/doc/maql/outerjoins09.png)
54
+
55
+
56
+
57
+ ## Syntax
58
+
59
+ \`\`\`
60
+ SELECT ... BY ... FOR EACH (attribute/label), (attribute/label), ...
61
+ \`\`\`
62
+
63
+ ## Examples
64
+
65
+ Display the sum for all sold items every month. The \`FOR EACH\` clause displays also items and months with no sale.
66
+ \`\`\`
67
+ SELECT SUM(fact/sales) FOR EACH (attribute/saledate.month), (attribute/item)
68
+ \`\`\`
69
+
70
+ Display the moving average. The \`FOR EACH\` clause displays also the days without any change.
71
+ \`\`\`
72
+ SELECT RUNAVG({metric/value}) ROWS BETWEEN 6 PRECEDING AND CURRENT ROW FOR EACH(date.day)
73
+ \`\`\`
74
+
75
+ Display the moving average. The \`FOR EACH\` clause displays also the days without any change and shows missing values as zeros.
76
+ \`\`\`
77
+ SELECT RUNAVG( IFNULL({metric/value},0)) ROWS BETWEEN 6 PRECEDING AND CURRENT ROW FOR EACH(date.day)
78
+ \`\`\`
79
+
80
+ Display the bottom 10 products with the lowest number of orders. The \`FOR EACH\` clause counts also the products with no orders.
81
+ \`\`\`
82
+ SELECT COUNT({label/order_id}) FOR EACH {label/product_name} WHERE BOTTOM(10) OF (COUNT({label/order_id}) )
83
+ \`\`\`
84
+
85
+ ## Data Source Support for Dates
86
+
87
+ Some of the data sources may not fully support FOR EACH with **date attributes**:
88
+
89
+ * *Dremio*, *Drill*, *Redshift*, and *Synapse* do not support FOR EACH for date attributes.
90
+
91
+ * *SQL Server 2022 (16.x)*, *Azure SQL Database* and *Azure SQL Managed Instance* support date attributes only from the compatibility level 160.
92
+
93
+ Other data sources fully support FOR EACH for all attributes.
94
+
95
+ You can create metrics with FOR EACH even if your data source does not support it. If you add such metric to a visualization, Analytical Designer will display an error.
96
+ {{% /alert %}}`;
@@ -0,0 +1,2 @@
1
+ export declare const content = "# FOR NextPeriod\nFOR NextPeriod function allows you to compute a metric for a future time\nperiod the granularity of which is determined contextually by the most\ngranular date attribute that is defined in the visualization.\n\nFOR NextPeriod works similarly to FOR Next function unless the\nadaptable functions adapt to the context of the visualization. Even\nthough the metric is defined as FOR NextPeriod(Quarter), for example,\nthe function returns values from the next month, as month is the most\ngranular date attribute in this visualization.\n\n## Syntax\n\n```\nSELECT \u2026 FOR NextPeriod(\u2026,\u2026)\nSELECT metric FOR NextPeriod( time_attribute )\n```\n\n## Examples\n\n```\nSELECT {metric/revenue} FOR NextPeriod({attribute/quarter} )\nSELECT {metric/payment} FOR NextPeriod({attribute/quarter} , 3)\n```\n\nAs was the case for the functions Previous( ) and PreviousPeriod( ), see\n[Functions For Referring to Past Time Periods](https://www.gooddata.com/developers/cloud-native/doc/hosted/create-metrics/maql/time/functions-for-referring-to-past-time-periods/),\nthe differences between Next( ) and NextPeriod( ) become most relevant\nwhen a visualization contains a more granular date attribute than the one that is specified\nwithin the functions themselves.\n\nThe chart below demonstrates the\ndifferences between `Leads FOR Next{attribute/quarter})` and `Leads FOR\nNextPeriod{attribute/quarter})` in a visualization broken across a more granular *Date*\nattribute.\n\n![iThe Next( ) function strictly follows the date attribute specified within the functions parentheses.](https://www.gooddata.com/developers/cloud-native/doc/maql/for-next-period.jpg)";
2
+ //# sourceMappingURL=for-next-period.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"for-next-period.d.ts","sourceRoot":"","sources":["../../../../../../../src/docs/en/docs/create-metrics/maql/time/for-next-period.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,gpDAoCoK,CAAC"}
@@ -0,0 +1,38 @@
1
+ // (C) 2021-2026 GoodData Corporation
2
+ export const content = `# FOR NextPeriod
3
+ FOR NextPeriod function allows you to compute a metric for a future time
4
+ period the granularity of which is determined contextually by the most
5
+ granular date attribute that is defined in the visualization.
6
+
7
+ FOR NextPeriod works similarly to FOR Next function unless the
8
+ adaptable functions adapt to the context of the visualization. Even
9
+ though the metric is defined as FOR NextPeriod(Quarter), for example,
10
+ the function returns values from the next month, as month is the most
11
+ granular date attribute in this visualization.
12
+
13
+ ## Syntax
14
+
15
+ \`\`\`
16
+ SELECT … FOR NextPeriod(…,…)
17
+ SELECT metric FOR NextPeriod( time_attribute )
18
+ \`\`\`
19
+
20
+ ## Examples
21
+
22
+ \`\`\`
23
+ SELECT {metric/revenue} FOR NextPeriod({attribute/quarter} )
24
+ SELECT {metric/payment} FOR NextPeriod({attribute/quarter} , 3)
25
+ \`\`\`
26
+
27
+ As was the case for the functions Previous( ) and PreviousPeriod( ), see
28
+ [Functions For Referring to Past Time Periods](https://www.gooddata.com/developers/cloud-native/doc/hosted/create-metrics/maql/time/functions-for-referring-to-past-time-periods/),
29
+ the differences between Next( ) and NextPeriod( ) become most relevant
30
+ when a visualization contains a more granular date attribute than the one that is specified
31
+ within the functions themselves.
32
+
33
+ The chart below demonstrates the
34
+ differences between \`Leads FOR Next{attribute/quarter})\` and \`Leads FOR
35
+ NextPeriod{attribute/quarter})\` in a visualization broken across a more granular *Date*
36
+ attribute.
37
+
38
+ ![iThe Next( ) function strictly follows the date attribute specified within the functions parentheses.](https://www.gooddata.com/developers/cloud-native/doc/maql/for-next-period.jpg)`;
@@ -0,0 +1,2 @@
1
+ export declare const content = "# FOR Next\nBy default, the FOR Next function refers to values from one time period\nin the future. This can be customized by adding a second parameter to\nthe function.\n\n## Syntax\n\n```\nSELECT \u2026 FOR Next(\u2026,\u2026)\nSELECT metric FOR Next(time_attribute)\n```\n\n## Examples\n\n```\nSELECT {metric/revenue} FOR Next({attribute/quarter})\n```\n\nYou can customize FOR Next() by adding a second parameter to the\nfunction. For example, you might want to return a payment value from\nthree quarters in the future with respect to a certain time period (see\nbelow).\n\n```\nSELECT {metric/payment} FOR Next({attribute/quarter},3)\n```";
2
+ //# sourceMappingURL=for-next.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"for-next.d.ts","sourceRoot":"","sources":["../../../../../../../src/docs/en/docs/create-metrics/maql/time/for-next.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,yoBAyBb,CAAC"}
@@ -0,0 +1,27 @@
1
+ // (C) 2021-2026 GoodData Corporation
2
+ export const content = `# FOR Next
3
+ By default, the FOR Next function refers to values from one time period
4
+ in the future. This can be customized by adding a second parameter to
5
+ the function.
6
+
7
+ ## Syntax
8
+
9
+ \`\`\`
10
+ SELECT … FOR Next(…,…)
11
+ SELECT metric FOR Next(time_attribute)
12
+ \`\`\`
13
+
14
+ ## Examples
15
+
16
+ \`\`\`
17
+ SELECT {metric/revenue} FOR Next({attribute/quarter})
18
+ \`\`\`
19
+
20
+ You can customize FOR Next() by adding a second parameter to the
21
+ function. For example, you might want to return a payment value from
22
+ three quarters in the future with respect to a certain time period (see
23
+ below).
24
+
25
+ \`\`\`
26
+ SELECT {metric/payment} FOR Next({attribute/quarter},3)
27
+ \`\`\``;
@@ -0,0 +1,2 @@
1
+ export declare const content = "# FOR PreviousPeriod\nThe FOR PreviousPeriod function is similar to FOR Previous functions\nunless the adaptable functions adapt to the context of the visualization by\nhand.\n\nEven though the metric is defined as FOR PreviousPeriod({attribute/quarter}),\nfor example, the function returns values from the previous month, as\nmonth is the most granular date attribute in this visualization.\n\n## Syntax\n\n```\nSELECT \u2026 FOR PreviousPeriod(\u2026,\u2026)\nSELECT metric FOR PreviousPeriod(time_attribute)\n```\n\n## Examples\n\n```\nSELECT {metric/payment} FOR PreviousPeriod({attribute/quarter})\nSELECT {metric/payment} FOR PreviousPeriod({attribute/quarter}, 2)\n```\n\nFor differences between FOR Previous and FOR PreviousPeriod,\nsee [Functions For Referring to Past Time Periods](https://www.gooddata.com/developers/cloud-native/doc/hosted/create-metrics/maql/time/functions-for-referring-to-past-time-periods/).";
2
+ //# sourceMappingURL=for-previous-period.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"for-previous-period.d.ts","sourceRoot":"","sources":["../../../../../../../src/docs/en/docs/create-metrics/maql/time/for-previous-period.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,i6BAwBoK,CAAC"}
@@ -0,0 +1,26 @@
1
+ // (C) 2021-2026 GoodData Corporation
2
+ export const content = `# FOR PreviousPeriod
3
+ The FOR PreviousPeriod function is similar to FOR Previous functions
4
+ unless the adaptable functions adapt to the context of the visualization by
5
+ hand.
6
+
7
+ Even though the metric is defined as FOR PreviousPeriod({attribute/quarter}),
8
+ for example, the function returns values from the previous month, as
9
+ month is the most granular date attribute in this visualization.
10
+
11
+ ## Syntax
12
+
13
+ \`\`\`
14
+ SELECT … FOR PreviousPeriod(…,…)
15
+ SELECT metric FOR PreviousPeriod(time_attribute)
16
+ \`\`\`
17
+
18
+ ## Examples
19
+
20
+ \`\`\`
21
+ SELECT {metric/payment} FOR PreviousPeriod({attribute/quarter})
22
+ SELECT {metric/payment} FOR PreviousPeriod({attribute/quarter}, 2)
23
+ \`\`\`
24
+
25
+ For differences between FOR Previous and FOR PreviousPeriod,
26
+ see [Functions For Referring to Past Time Periods](https://www.gooddata.com/developers/cloud-native/doc/hosted/create-metrics/maql/time/functions-for-referring-to-past-time-periods/).`;
@@ -0,0 +1,2 @@
1
+ export declare const content = "# FOR Previous\nBy default, the FOR Previous function refers to values from one time\nperiod ago. You can customize FOR Previous by adding a second parameter\nto the function.\n\n## Syntax\n\n```\nSELECT \u2026 FOR Previous(\u2026,\u2026)\nSELECT metric FOR Previous(time_attribute)\nSELECT metric FOR Previous(time_attribute, #periods_ago)\n```\n\n## Examples\n\n```\nSELECT {metric/revenues} FOR Previous({attribute/quarter})\n```\n\nYou can customize FOR Previous() by adding a second parameter to the function. For\nexample, you may want to return a revenue value from three quarters ago\n(see below).\n\n```\nSELECT {metric/revenues} FOR Previous({attribute/quarter} , 3)\n```\n\nFor differences between FOR Previous and FOR PreviousPeriod,\nsee [Functions For Referring to Past Time Periods](https://www.gooddata.com/developers/cloud-native/doc/hosted/create-metrics/maql/time/functions-for-referring-to-past-time-periods/).";
2
+ //# sourceMappingURL=for-previous.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"for-previous.d.ts","sourceRoot":"","sources":["../../../../../../../src/docs/en/docs/create-metrics/maql/time/for-previous.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,u6BA4BoK,CAAC"}
@@ -0,0 +1,30 @@
1
+ // (C) 2021-2026 GoodData Corporation
2
+ export const content = `# FOR Previous
3
+ By default, the FOR Previous function refers to values from one time
4
+ period ago. You can customize FOR Previous by adding a second parameter
5
+ to the function.
6
+
7
+ ## Syntax
8
+
9
+ \`\`\`
10
+ SELECT … FOR Previous(…,…)
11
+ SELECT metric FOR Previous(time_attribute)
12
+ SELECT metric FOR Previous(time_attribute, #periods_ago)
13
+ \`\`\`
14
+
15
+ ## Examples
16
+
17
+ \`\`\`
18
+ SELECT {metric/revenues} FOR Previous({attribute/quarter})
19
+ \`\`\`
20
+
21
+ You can customize FOR Previous() by adding a second parameter to the function. For
22
+ example, you may want to return a revenue value from three quarters ago
23
+ (see below).
24
+
25
+ \`\`\`
26
+ SELECT {metric/revenues} FOR Previous({attribute/quarter} , 3)
27
+ \`\`\`
28
+
29
+ For differences between FOR Previous and FOR PreviousPeriod,
30
+ see [Functions For Referring to Past Time Periods](https://www.gooddata.com/developers/cloud-native/doc/hosted/create-metrics/maql/time/functions-for-referring-to-past-time-periods/).`;
@@ -0,0 +1,2 @@
1
+ export declare const content = "# Functions For Referring to Past Time Periods\nThe following MAQL functions allow you to create metrics showing a time\nover time comparison (for example, month over month, or quarter over\nquarter) of past time periods:\n\n- [FOR Previous](https://www.gooddata.com/developers/cloud-native/doc/hosted/create-metrics/maql/time/for-previous/)\n- [FOR PreviousPeriod](https://www.gooddata.com/developers/cloud-native/doc/hosted/create-metrics/maql/time/for-previous-period/)\n\n## Differences Between FOR Previous and FOR PreviousPeriod\n\nThe difference between the Previous( ) and PreviousPeriod( ) functions\nbecomes clear when the date attribute in a visualization is more granular than the\ndate attribute specified within the function's parentheses.\n\nFOR Previous( ) strictly follows the date attribute specified by the\nmetric author within the parentheses of the function.\n\nOn the other hand, FOR PreviousPeriod( ) adapts to the context of the\nvisualization. Regardless of the date attribute specified by the metric, the PreviousPeriod( ) function takes on the date attribute of the smallest granularity in the visualization.\n\nIn the following example, even though the metric in the final column has\nbeen defined as `FOR PreviousPeriod(quarter)`, the function returns\nvalues from the previous *month*, as month is the most granular date\nattribute in this visualization.\n\nThe Previous( ) function strictly follows the date attribute specified within the function's parentheses. PreviousPeriod ( ) takes on the most granular date attribute that is contained within the visualization.\n\n![PreviousPeriod](https://www.gooddata.com/developers/cloud-native/doc/maql/for-previous-period.png)\n\nEven if PreviousPeriod( ) automatically takes on the granularity of the\nsmallest date attribute in a visualization, it is still important to specify a\ndate attribute within the PreviousPeriod( ) function as a way of\nspecifying the date dimension of interest. This is because workspaces\noften have multiple date dimensions, such as Date(Lead Created),\nDate(MQL Qualified), or Date(Snapshot).";
2
+ //# sourceMappingURL=functions-for-referring-to-past-time-periods.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functions-for-referring-to-past-time-periods.d.ts","sourceRoot":"","sources":["../../../../../../../src/docs/en/docs/create-metrics/maql/time/functions-for-referring-to-past-time-periods.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,+jEAkCoB,CAAC"}
@@ -0,0 +1,36 @@
1
+ // (C) 2021-2026 GoodData Corporation
2
+ export const content = `# Functions For Referring to Past Time Periods
3
+ The following MAQL functions allow you to create metrics showing a time
4
+ over time comparison (for example, month over month, or quarter over
5
+ quarter) of past time periods:
6
+
7
+ - [FOR Previous](https://www.gooddata.com/developers/cloud-native/doc/hosted/create-metrics/maql/time/for-previous/)
8
+ - [FOR PreviousPeriod](https://www.gooddata.com/developers/cloud-native/doc/hosted/create-metrics/maql/time/for-previous-period/)
9
+
10
+ ## Differences Between FOR Previous and FOR PreviousPeriod
11
+
12
+ The difference between the Previous( ) and PreviousPeriod( ) functions
13
+ becomes clear when the date attribute in a visualization is more granular than the
14
+ date attribute specified within the function's parentheses.
15
+
16
+ FOR Previous( ) strictly follows the date attribute specified by the
17
+ metric author within the parentheses of the function.
18
+
19
+ On the other hand, FOR PreviousPeriod( ) adapts to the context of the
20
+ visualization. Regardless of the date attribute specified by the metric, the PreviousPeriod( ) function takes on the date attribute of the smallest granularity in the visualization.
21
+
22
+ In the following example, even though the metric in the final column has
23
+ been defined as \`FOR PreviousPeriod(quarter)\`, the function returns
24
+ values from the previous *month*, as month is the most granular date
25
+ attribute in this visualization.
26
+
27
+ The Previous( ) function strictly follows the date attribute specified within the function's parentheses. PreviousPeriod ( ) takes on the most granular date attribute that is contained within the visualization.
28
+
29
+ ![PreviousPeriod](https://www.gooddata.com/developers/cloud-native/doc/maql/for-previous-period.png)
30
+
31
+ Even if PreviousPeriod( ) automatically takes on the granularity of the
32
+ smallest date attribute in a visualization, it is still important to specify a
33
+ date attribute within the PreviousPeriod( ) function as a way of
34
+ specifying the date dimension of interest. This is because workspaces
35
+ often have multiple date dimensions, such as Date(Lead Created),
36
+ Date(MQL Qualified), or Date(Snapshot).`;
@@ -0,0 +1,2 @@
1
+ export declare const content = "# DATETIME_ADD\nThe `DATETIME_ADD` function adds a specified amount of intervals based on the granularity. \n\n## Syntax\n\n```\nSELECT \u2026 WHERE DATETIME_ADD(time_attribute, amount) >= time_attribute\nSELECT \u2026 WHERE DATETIME_ADD(time_attribute, granularity, amount) >= time_attribute\n```\n\n**Time attribute** can have the following formats:\n- Timestamp: ` {label/date.day}`\n- Date and time macro: `THIS(DAY)`\n- Strings: `\"2022\"` \n\nThe strings must be in the following formats: \n\n`\"YYYY-MM-DD HH24:MI\"` for minutes, `\"YYYY-MM-DD HH24\"` for hours, `\"YYYY-MM-DD\"` for days, `\"YYYY-MM\"` for months, `\"YYYY-WW\"` for weeks, and `\"YYYY\"` for years.\n\n**Amount** is an integer and specifies the amount of intervals of the given granularity.\n\n**Granularity** can be one of the following:\n* `MINUTE`\n* `HOUR`\n* `DAY`\n* `WEEK`\n* `MONTH`\n* `YEAR`\n\n* If the time attribute is a string, you must specify the granularity.\n* The granularity of the time attribute and the specified granularity in the function may be different.\n* If you do not specify the granularity, the granularity of the time attribute is used.\n\n## Examples\n\nReturn the number of loans that was returned in the last three days:\n\n```\nSELECT COUNT({label/l_loankey}) WHERE {label/l_returned.day} >= DATETIME_ADD({label/l_to.day}, -2)\n```\n\nReturn the number of loans from the 20th week of 2022:\n\n```\nSELECT COUNT({label/l_loankey}) WHERE {label/l_from.day} >= DATETIME_ADD(\"2022-01\", WEEK, 19) \n```\n\nReturn the sum of the shipping prices in the 7 days before the last returned loan.\n\n```\nSELECT SUM({fact/l_shippingprice}) WHERE {label/l_returned.day} >= DATETIME_ADD(MAX({label/l_returned.day}, {dataset/loan}), -7) \n```";
2
+ //# sourceMappingURL=datetime-add.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datetime-add.d.ts","sourceRoot":"","sources":["../../../../../../../src/docs/en/docs/create-metrics/maql/time-arithmetics/datetime-add.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,gtDAmDb,CAAC"}
@@ -0,0 +1,53 @@
1
+ // (C) 2021-2026 GoodData Corporation
2
+ export const content = `# DATETIME_ADD
3
+ The \`DATETIME_ADD\` function adds a specified amount of intervals based on the granularity.
4
+
5
+ ## Syntax
6
+
7
+ \`\`\`
8
+ SELECT … WHERE DATETIME_ADD(time_attribute, amount) >= time_attribute
9
+ SELECT … WHERE DATETIME_ADD(time_attribute, granularity, amount) >= time_attribute
10
+ \`\`\`
11
+
12
+ **Time attribute** can have the following formats:
13
+ - Timestamp: \` {label/date.day}\`
14
+ - Date and time macro: \`THIS(DAY)\`
15
+ - Strings: \`"2022"\`
16
+
17
+ The strings must be in the following formats:
18
+
19
+ \`"YYYY-MM-DD HH24:MI"\` for minutes, \`"YYYY-MM-DD HH24"\` for hours, \`"YYYY-MM-DD"\` for days, \`"YYYY-MM"\` for months, \`"YYYY-WW"\` for weeks, and \`"YYYY"\` for years.
20
+
21
+ **Amount** is an integer and specifies the amount of intervals of the given granularity.
22
+
23
+ **Granularity** can be one of the following:
24
+ * \`MINUTE\`
25
+ * \`HOUR\`
26
+ * \`DAY\`
27
+ * \`WEEK\`
28
+ * \`MONTH\`
29
+ * \`YEAR\`
30
+
31
+ * If the time attribute is a string, you must specify the granularity.
32
+ * The granularity of the time attribute and the specified granularity in the function may be different.
33
+ * If you do not specify the granularity, the granularity of the time attribute is used.
34
+
35
+ ## Examples
36
+
37
+ Return the number of loans that was returned in the last three days:
38
+
39
+ \`\`\`
40
+ SELECT COUNT({label/l_loankey}) WHERE {label/l_returned.day} >= DATETIME_ADD({label/l_to.day}, -2)
41
+ \`\`\`
42
+
43
+ Return the number of loans from the 20th week of 2022:
44
+
45
+ \`\`\`
46
+ SELECT COUNT({label/l_loankey}) WHERE {label/l_from.day} >= DATETIME_ADD("2022-01", WEEK, 19)
47
+ \`\`\`
48
+
49
+ Return the sum of the shipping prices in the 7 days before the last returned loan.
50
+
51
+ \`\`\`
52
+ SELECT SUM({fact/l_shippingprice}) WHERE {label/l_returned.day} >= DATETIME_ADD(MAX({label/l_returned.day}, {dataset/loan}), -7)
53
+ \`\`\``;
@@ -0,0 +1,2 @@
1
+ export declare const content = "# DATETIME_DIFF\nThe `DATETIME_DIFF` function calculates the difference between two timestamps or dates. The resulting number is the difference between the two specified timestamps/dates based on the granularity. \n\nThe function can be used, for example, to calculate the duration of your business processes.\n\n## Syntax\n\n```\nSELECT DATETIME_DIFF(time_attribute1, time_attribute2)\nSELECT DATETIME_DIFF(time_attribute1, time_attribute2, granularity)\nSELECT \u2026 WHERE DATETIME_DIFF(time_attribute1, time_attribute2) > 5\n```\n**Time attributes** can have the following formats:\n- Timestamp: ` {label/date.day}`\n- Date and time macro: `THIS(DAY)`\n- Strings: `\"2022\"` \n\n* The strings must be in the following formats: `\"YYYY-MM-DD HH24:MI\"` for minutes, `\"YYYY-MM-DD HH24\"` for hours, `\"YYYY-MM-DD\"` for days, `\"YYYY-MM\"` for months, `\"YYYY-WW\"` for weeks, and `\"YYYY\"` for years..\n* Use max one string as time attribute.\n* Strings must have the same granularity as the second time attribute.\n\n\n**Granularity** is optional and can be one of the following:\n* `MINUTE`\n* `HOUR`\n* `DAY`\n* `WEEK`\n* `MONTH`\n* `YEAR`\n\n* If the time attribute is in the `date` format, you cannot use the `MINUTE` or `HOUR` granularity.\n* If you do not specify the granularity, the greater granularity of the two date attributes is used.\n* If you specify the granularity, the two attributes must have the same or lower granularity.\n\n\n## Examples\n\nTo count the difference between two dates without specifying the granularity (the granularity is taken from the attributes):\n\n```\nSELECT DATETIME_DIFF({label/l_from.day}, {label/l_to.day})\n```\n\nDifference in days between two time attributes with hour granularity:\n\n```\nSELECT DATETIME_DIFF({label/l_from.hour}, {label/l_to.hour}, DAY)\n```\n\nFilter data where the duration is greater than the specified amount:\n\n```\nSELECT COUNT({dataset/item}) WHERE DATETIME_DIFF({label/i_decommisioned.day}, THIS(DAY)) > 10\n```";
2
+ //# sourceMappingURL=datetime-diff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datetime-diff.d.ts","sourceRoot":"","sources":["../../../../../../../src/docs/en/docs/create-metrics/maql/time-arithmetics/datetime-diff.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,g9DAqDb,CAAC"}
@@ -0,0 +1,55 @@
1
+ // (C) 2021-2026 GoodData Corporation
2
+ export const content = `# DATETIME_DIFF
3
+ The \`DATETIME_DIFF\` function calculates the difference between two timestamps or dates. The resulting number is the difference between the two specified timestamps/dates based on the granularity.
4
+
5
+ The function can be used, for example, to calculate the duration of your business processes.
6
+
7
+ ## Syntax
8
+
9
+ \`\`\`
10
+ SELECT DATETIME_DIFF(time_attribute1, time_attribute2)
11
+ SELECT DATETIME_DIFF(time_attribute1, time_attribute2, granularity)
12
+ SELECT … WHERE DATETIME_DIFF(time_attribute1, time_attribute2) > 5
13
+ \`\`\`
14
+ **Time attributes** can have the following formats:
15
+ - Timestamp: \` {label/date.day}\`
16
+ - Date and time macro: \`THIS(DAY)\`
17
+ - Strings: \`"2022"\`
18
+
19
+ * The strings must be in the following formats: \`"YYYY-MM-DD HH24:MI"\` for minutes, \`"YYYY-MM-DD HH24"\` for hours, \`"YYYY-MM-DD"\` for days, \`"YYYY-MM"\` for months, \`"YYYY-WW"\` for weeks, and \`"YYYY"\` for years..
20
+ * Use max one string as time attribute.
21
+ * Strings must have the same granularity as the second time attribute.
22
+
23
+
24
+ **Granularity** is optional and can be one of the following:
25
+ * \`MINUTE\`
26
+ * \`HOUR\`
27
+ * \`DAY\`
28
+ * \`WEEK\`
29
+ * \`MONTH\`
30
+ * \`YEAR\`
31
+
32
+ * If the time attribute is in the \`date\` format, you cannot use the \`MINUTE\` or \`HOUR\` granularity.
33
+ * If you do not specify the granularity, the greater granularity of the two date attributes is used.
34
+ * If you specify the granularity, the two attributes must have the same or lower granularity.
35
+
36
+
37
+ ## Examples
38
+
39
+ To count the difference between two dates without specifying the granularity (the granularity is taken from the attributes):
40
+
41
+ \`\`\`
42
+ SELECT DATETIME_DIFF({label/l_from.day}, {label/l_to.day})
43
+ \`\`\`
44
+
45
+ Difference in days between two time attributes with hour granularity:
46
+
47
+ \`\`\`
48
+ SELECT DATETIME_DIFF({label/l_from.hour}, {label/l_to.hour}, DAY)
49
+ \`\`\`
50
+
51
+ Filter data where the duration is greater than the specified amount:
52
+
53
+ \`\`\`
54
+ SELECT COUNT({dataset/item}) WHERE DATETIME_DIFF({label/i_decommisioned.day}, THIS(DAY)) > 10
55
+ \`\`\``;
@@ -0,0 +1,2 @@
1
+ export declare const content = "# Time Macros\nTime macros or time macro functions are \"floating\" references to day, month, week, and other date-related attribute values, relative to the present.\nMAQL supports the following time macro functions:\n\n- THIS\n- PREVIOUS\n- NEXT\n\nThese macros are useful for creating visualizations that relate to data from \"today\", \"yesterday\", \"this month\", \"next year\" etc.\n\n### \"THIS\" Macro\n\nTHIS macro references the current value of the specified date granularity.\n\nIn the following example, THIS macro is used with the day granularity, effectively meaning *this day*, or \"today\":\n\n```\nSELECT {metric/payment} WHERE {attribute/date} = THIS(DAY)\n```\n\nIf the date granularity of the macro changes, so does the meaning of THIS. You can use following time macro granularities:\n\n- DAY\n- MONTH\n- QUARTER\n- YEAR\n- WEEK\n- WEEKOFYEAR\n- MONTHOFYEAR\n- QUARTEROFYEAR\n- DAYOFMONTH\n- DAYOFWEEK\n- DAYOFYEAR\n\nOther date granularities supported by GoodData platform (such as HOUR, MINUTE etc.) are currently not available for time macros.\n\n### Referencing past or future dates\n\nOptionally you can specify second parameter of THIS macro to reference future\nor previous time periods. For example,\n\n```\nSELECT {metric/payment} WHERE {attribute/month} = THIS(Month, -2)\n```\n\ncomputes payments of the month two months ago.\n\nTo illustrate more, suppose the current date is **November 3, 2014**.\nThen following table summarizes values of THIS macro for various combinations of granularities (in rows) and period shifts (columns).\nNote that `THIS(<granularity>, 0)` is equivalent to `THIS(<granularity>)`.\n\n| | 0 | 2 | -1 |\n| - | - | - | - |\n| Day | 11/3/2014 | 11/5/2014 | 11/2/2014 |\n| DayOfWeek | 1 (Monday) | 3 (Wednesday) | 0 (Sunday) |\n| MonthOfYear | 11 (November) | 1 (January) | 10 (October) |\n| QuarterOfYear | Q4 | Q2 | Q3 |\n| Quarter | Q4/2014 | Q2/2015 | Q3/2014 |\n\n\nNotice that if the date granularity is periodic, such as QuarterOfYear (Q1, Q2,\nQ3, Q4) or MonthOfYear (January, February, March, etc), the resulting value might roll over to the next or\nbackward to the previous period.\n\n### \"PREVIOUS\" and \"NEXT\" Macros\n\nFor convenience MAQL also supports shortcuts for the other two most common relative periods: previous and next.\n\n- `PREVIOUS(<granularity>)` is equivalent to `THIS(<granularity>, -1)`\n- `NEXT(<granularity>)` is equivalent to `THIS(<granularity>, 1)`\n- `PREVIOUS(<granularity>, <shift>)` is equivalent to `THIS(<granularity>, - <shift>)`\n- `NEXT(<granularity>, <shift>)` is equivalent to `THIS(<granularity>, shift>)`\n\nExample:\n\n```\nSELECT {metric/payment} WHERE {attribute/month} = PREVIOUS(Month)\n```";
2
+ //# sourceMappingURL=time-macros.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"time-macros.d.ts","sourceRoot":"","sources":["../../../../../../src/docs/en/docs/create-metrics/maql/time-macros.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,wpFA6Eb,CAAC"}