@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,2 @@
1
+ export declare const content = "# AVG\nThe AVG function returns the average value of all numbers in the set (e.g., Salary paid). Null values are ignored.\n\n## Syntax\n\n```\nSELECT AVG(\u2026)\nSELECT AVG(fact)\n```\n\n## Examples\n\nThe metric AVG of Payment is computed by adding all payment transactions\ntogether and dividing by the number of payment transactions:\n\n```\nSELECT AVG({fact/payment})\n```";
2
+ //# sourceMappingURL=avg.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"avg.d.ts","sourceRoot":"","sources":["../../../../../../../src/docs/en/docs/create-metrics/maql/aggregation/avg.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,8XAiBb,CAAC"}
@@ -0,0 +1,19 @@
1
+ // (C) 2021-2026 GoodData Corporation
2
+ export const content = `# AVG
3
+ The AVG function returns the average value of all numbers in the set (e.g., Salary paid). Null values are ignored.
4
+
5
+ ## Syntax
6
+
7
+ \`\`\`
8
+ SELECT AVG(…)
9
+ SELECT AVG(fact)
10
+ \`\`\`
11
+
12
+ ## Examples
13
+
14
+ The metric AVG of Payment is computed by adding all payment transactions
15
+ together and dividing by the number of payment transactions:
16
+
17
+ \`\`\`
18
+ SELECT AVG({fact/payment})
19
+ \`\`\``;
@@ -0,0 +1,2 @@
1
+ export declare const content = "# COUNT\nUse COUNT to return the number of unique values for an attribute or the number of dataset records.\n - For large amounts of data where complete accuracy is not a priority, consider using APPROXIMATE_COUNT to increase the processing speed. APPROXIMATE_COUNT is available only for workspaces that use [Vertica](https://www.gooddata.com/developers/cloud-native/doc/hosted/connect-data/create-data-sources/vertica/) as a data source.\n\n## Syntax\n\nCOUNT uses the following syntax:\n\n\n |Form | Syntax | Example|\n |------------------ |------------------------------------------------------------| --------------------------------------------|\n |single parameter |`SELECT COUNT(attribute)` |`SELECT COUNT({attribute/order_id})`|\n |two parameters |`SELECT COUNT(attribute, primary_key)` |`SELECT COUNT({attribute/order_id}, {attribute/campaign_id})`|\n | |`SELECT COUNT(attribute, dataset)` |`SELECT COUNT({attribute/order_id}, {SELECT COUNT({attribute/order_id}, {dataset/campaigns})`|\n |with USING |`SELECT COUNT(attribute) USING primary_key` |`SELECT COUNT({attribute/order_id}) USING {attribute/campaign_id}`|\n | |`SELECT COUNT(attribute) USING dataset` |`SELECT COUNT({attribute/order_id}) USING {dataset/campaigns}`|\n\n\n### Single-Parameter Version\n\nThe single-parameter version of COUNT dynamically gets the context of\nwhere to count from the visualization it is used in.\n\n### Two-Parameter Version\n\nIn the two-parameter version, the context where to count the attribute\nis determined explicitly by the second parameter - the primary key of\nthe dataset.\n\nThe primary key is connection point between datasets. It connects the\nCOUNT function's first parameter to the dataset in which the count is\nto take place.\n\n### Count of Dataset Records \nYou can use a dataset identifier as the first argument of COUNT as well. The behavior of COUNT slightly changes depending on whether a primary key is defined in the dataset. \n\nIf there is a primary key, the number of unique values of the primary key attribute is returned. \n\nIf there is no primary key attribute, the count of all records (including possible duplicates) is returned.\n\n|Form | Syntax | Example|\n |------------------ |------------------------------------------------------------| --------------------------------------------|\n |single parameter |`SELECT COUNT(dataset)` |`SELECT COUNT({dataset/order_lines})`|\n\n\n### Specifying COUNT Context Resolution with USING\n\nIn a metric, USING provides a hint for which context should be used.\nThe context for the computation of COUNT may be ambiguous if there are\nmultiple fact datasets in your logical data model that relate to a counted attribute. \n\nThe following image shows a model with the fact datasets `Purchases` and `Sales` and\nhas both datasets connected to the `Store ID` and `Product ID` attributes.\n\n![model for count example](https://www.gooddata.com/developers/cloud-native/doc/maql/count-ldm-using.png)\n\nTo create a metric that resolves with a specific context, you can specify USING in your metric like in the following \nexample: `SELECT COUNT({label/inventory.productid}) USING {label/purchases.purchaseid}`. \n\nWith this example, the visualization will show the number of uniquely purchased products per store \nbecause the attribute `Purchase ID` from the `Purchases` dataset is in the USING clause.\n\nWith the example model, if you build a visualization to display the count of products per store with \n`SELECT COUNT({label/inventory.productid})` and slice it by Store without specifying USING, it is ambiguous whether \nthe visualization is displaying the number of unique products that have been purchased by store or the number of unique \nproducts that have been sold by the store.\n\nThe attribute in the USING clause can be any attribute which uniquely determines the correct context. For example, you\ncan also use an attribute from the `Purchase Date` dataset in the USING clause. This uses the `Purchases` dataset as \nthe context because the `Sales` dataset has no relationships to `Purchase Date`: \n`SELECT COUNT({label/inventory.productid}) USING {label/purchasedate.year}`";
2
+ //# sourceMappingURL=count.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"count.d.ts","sourceRoot":"","sources":["../../../../../../../src/docs/en/docs/create-metrics/maql/aggregation/count.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,w2IAsE0D,CAAC"}
@@ -0,0 +1,72 @@
1
+ // (C) 2021-2026 GoodData Corporation
2
+ export const content = `# COUNT
3
+ Use COUNT to return the number of unique values for an attribute or the number of dataset records.
4
+ - For large amounts of data where complete accuracy is not a priority, consider using APPROXIMATE_COUNT to increase the processing speed. APPROXIMATE_COUNT is available only for workspaces that use [Vertica](https://www.gooddata.com/developers/cloud-native/doc/hosted/connect-data/create-data-sources/vertica/) as a data source.
5
+
6
+ ## Syntax
7
+
8
+ COUNT uses the following syntax:
9
+
10
+
11
+ |Form | Syntax | Example|
12
+ |------------------ |------------------------------------------------------------| --------------------------------------------|
13
+ |single parameter |\`SELECT COUNT(attribute)\` |\`SELECT COUNT({attribute/order_id})\`|
14
+ |two parameters |\`SELECT COUNT(attribute, primary_key)\` |\`SELECT COUNT({attribute/order_id}, {attribute/campaign_id})\`|
15
+ | |\`SELECT COUNT(attribute, dataset)\` |\`SELECT COUNT({attribute/order_id}, {SELECT COUNT({attribute/order_id}, {dataset/campaigns})\`|
16
+ |with USING |\`SELECT COUNT(attribute) USING primary_key\` |\`SELECT COUNT({attribute/order_id}) USING {attribute/campaign_id}\`|
17
+ | |\`SELECT COUNT(attribute) USING dataset\` |\`SELECT COUNT({attribute/order_id}) USING {dataset/campaigns}\`|
18
+
19
+
20
+ ### Single-Parameter Version
21
+
22
+ The single-parameter version of COUNT dynamically gets the context of
23
+ where to count from the visualization it is used in.
24
+
25
+ ### Two-Parameter Version
26
+
27
+ In the two-parameter version, the context where to count the attribute
28
+ is determined explicitly by the second parameter - the primary key of
29
+ the dataset.
30
+
31
+ The primary key is connection point between datasets. It connects the
32
+ COUNT function's first parameter to the dataset in which the count is
33
+ to take place.
34
+
35
+ ### Count of Dataset Records
36
+ You can use a dataset identifier as the first argument of COUNT as well. The behavior of COUNT slightly changes depending on whether a primary key is defined in the dataset.
37
+
38
+ If there is a primary key, the number of unique values of the primary key attribute is returned.
39
+
40
+ If there is no primary key attribute, the count of all records (including possible duplicates) is returned.
41
+
42
+ |Form | Syntax | Example|
43
+ |------------------ |------------------------------------------------------------| --------------------------------------------|
44
+ |single parameter |\`SELECT COUNT(dataset)\` |\`SELECT COUNT({dataset/order_lines})\`|
45
+
46
+
47
+ ### Specifying COUNT Context Resolution with USING
48
+
49
+ In a metric, USING provides a hint for which context should be used.
50
+ The context for the computation of COUNT may be ambiguous if there are
51
+ multiple fact datasets in your logical data model that relate to a counted attribute.
52
+
53
+ The following image shows a model with the fact datasets \`Purchases\` and \`Sales\` and
54
+ has both datasets connected to the \`Store ID\` and \`Product ID\` attributes.
55
+
56
+ ![model for count example](https://www.gooddata.com/developers/cloud-native/doc/maql/count-ldm-using.png)
57
+
58
+ To create a metric that resolves with a specific context, you can specify USING in your metric like in the following
59
+ example: \`SELECT COUNT({label/inventory.productid}) USING {label/purchases.purchaseid}\`.
60
+
61
+ With this example, the visualization will show the number of uniquely purchased products per store
62
+ because the attribute \`Purchase ID\` from the \`Purchases\` dataset is in the USING clause.
63
+
64
+ With the example model, if you build a visualization to display the count of products per store with
65
+ \`SELECT COUNT({label/inventory.productid})\` and slice it by Store without specifying USING, it is ambiguous whether
66
+ the visualization is displaying the number of unique products that have been purchased by store or the number of unique
67
+ products that have been sold by the store.
68
+
69
+ The attribute in the USING clause can be any attribute which uniquely determines the correct context. For example, you
70
+ can also use an attribute from the \`Purchase Date\` dataset in the USING clause. This uses the \`Purchases\` dataset as
71
+ the context because the \`Sales\` dataset has no relationships to \`Purchase Date\`:
72
+ \`SELECT COUNT({label/inventory.productid}) USING {label/purchasedate.year}\``;
@@ -0,0 +1,2 @@
1
+ export declare const content = "# FIRST_VALUE\nThe `FIRST_VALUE` function returns the first value of a sequence. \n\nThe function is typically used to determine the first value of semi-additive fact when used together with sum aggregation.\n\n\n## Syntax\n\n```\nSELECT FIRST_VALUE({numeric})\n ORDER BY {attribute/label} [ASC|DESC]\n [WITHIN (... | CURRENT)]\n\n```\n\nThe argument of the function is a metric or a subselect defining an aggregation.\n\n> If you use facts, make sure that the fact has only a single value defined for each `ORDER BY` attribute.\n\nThe sequence is determined by the attribute in `ORDER BY`. The metric is broken down by the given attribute and the results are displayed in the ascending order by default.\n\n> To show the result in the descending order, use the DESC directive.\n>\n> `NULL` values are considered as the smallest values.\n\nIf the metric is broken down by other attributes, these attributes define a partition in which the first value is being determined. \n\nUse the `WITHIN` keyword to avoid this behavior and use the common first value for all the values of the given attributes.\n\n## Examples\n\nThe first value of a sum of semi-additive snapshots from a dataset with daily snapshots. \n\nExample of such a semi-additive snapshot can be **account balance** (values of multiple accounts can be summed up but not their daily snapshots).\n\n```\nSELECT FIRST_VALUE(SUM({fact/snapshot_value})) ORDER BY {attribute/date.day}\n```\n\nFor a more complex example, see also [LAST_VALUE](https://www.gooddata.com/developers/cloud-native/doc/hosted/create-metrics/maql/aggregation/last/).";
2
+ //# sourceMappingURL=first.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"first.d.ts","sourceRoot":"","sources":["../../../../../../../src/docs/en/docs/create-metrics/maql/aggregation/first.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,6kDAuCkI,CAAC"}
@@ -0,0 +1,41 @@
1
+ // (C) 2021-2026 GoodData Corporation
2
+ export const content = `# FIRST_VALUE
3
+ The \`FIRST_VALUE\` function returns the first value of a sequence.
4
+
5
+ The function is typically used to determine the first value of semi-additive fact when used together with sum aggregation.
6
+
7
+
8
+ ## Syntax
9
+
10
+ \`\`\`
11
+ SELECT FIRST_VALUE({numeric})
12
+ ORDER BY {attribute/label} [ASC|DESC]
13
+ [WITHIN (... | CURRENT)]
14
+
15
+ \`\`\`
16
+
17
+ The argument of the function is a metric or a subselect defining an aggregation.
18
+
19
+ > If you use facts, make sure that the fact has only a single value defined for each \`ORDER BY\` attribute.
20
+
21
+ The sequence is determined by the attribute in \`ORDER BY\`. The metric is broken down by the given attribute and the results are displayed in the ascending order by default.
22
+
23
+ > To show the result in the descending order, use the DESC directive.
24
+ >
25
+ > \`NULL\` values are considered as the smallest values.
26
+
27
+ If the metric is broken down by other attributes, these attributes define a partition in which the first value is being determined.
28
+
29
+ Use the \`WITHIN\` keyword to avoid this behavior and use the common first value for all the values of the given attributes.
30
+
31
+ ## Examples
32
+
33
+ The first value of a sum of semi-additive snapshots from a dataset with daily snapshots.
34
+
35
+ Example of such a semi-additive snapshot can be **account balance** (values of multiple accounts can be summed up but not their daily snapshots).
36
+
37
+ \`\`\`
38
+ SELECT FIRST_VALUE(SUM({fact/snapshot_value})) ORDER BY {attribute/date.day}
39
+ \`\`\`
40
+
41
+ For a more complex example, see also [LAST_VALUE](https://www.gooddata.com/developers/cloud-native/doc/hosted/create-metrics/maql/aggregation/last/).`;
@@ -0,0 +1,2 @@
1
+ export declare const content = "# LAST_VALUE\nThe `LAST_VALUE` function returns the last value of a sequence. \n\nThe function is typically used to determine the last value of semi-additive fact when used together with sum aggregation.\n\n## Syntax\n\n```\nSELECT LAST_VALUE({numeric})\n ORDER BY {attribute/label} [ASC|DESC]\n [WITHIN (... | CURRENT)]\n\n```\n\nThe argument of the function is a metric or a subselect defining an aggregation.\n\n> If you use facts, make sure that the fact has only a single value defined for each `ORDER BY` attribute.\n\nThe sequence is determined by the attribute in `ORDER BY`. The metric is broken down by the given attribute and the results are displayed in the ascending order by default.\n\n> To show the result in the descending order, use the DESC directive.\n>\n> `NULL` values are considered as the smallest values.\n\nIf the metric is broken down by other attributes, these attributes define a partition in which the last value is being determined. \n\nUse the `WITHIN` keyword to avoid this behavior and use the common last value for all the values of the given attributes.\n\n> See also [FIRST_VALUE](https://www.gooddata.com/developers/cloud-native/doc/hosted/create-metrics/maql/aggregation/first/) for additional information.\n\n## Examples\n\nThe last value of a sum of semi-additive snapshots from a dataset with daily snapshots. \n\nExample of such a semi-additive snapshot can be **account balance** (values of multiple accounts can be summed up but not their daily snapshots).\n\n```\nSELECT LAST_VALUE(SUM({fact/snapshot_value})) ORDER BY {attribute/date.day}\n```\n\nTo show how much your account balance has grown since the beginning of the year, you can use the following metrics and syntax:\n\n| Metric | Syntax |\n| --- | --- |\n| last_day_value | `SELECT LAST_VALUE(SUM({fact/snapshot_value})) ORDER BY {attribute/date.day}` |\n| first_day_value_in_year | `SELECT FIRST_VALUE(SUM({fact/snapshot_value})) ORDER BY {attribute/date.day} WITHIN ({attribute/date.year})` |\n| growth_to_date | `SELECT {metric/last_day_value}/{metric/first_day_value_in_year}-1` |\n\n</br>\nThe result may look as follows:\n\n| Date - Month/Year| last_day_value | first_day_value_in_year | growth_to_date |\n| --- | --- | --- | --- |\n|2022-01|1,000|1,000|0%|\n|2022-02|2,000|1,000|+100%|\n|2022-03|3,000|1,000|+200%|\n|2022-04|4,000|1,000|+300%|\n|2022-05|5,000|1,000|+400%|\n|2022-06|6,000|1,000|+500%|\n|2022-07|7,000|1,000|+600%|\n|2022-08|8,000|1,000|+700%|\n|2022-09|9,000|1,000|+800%|\n|2022-10|10,000|1,000|+900%|\n|2022-11|11,000|1,000|+1000%|\n|2022-12|12,000|1,000|+1100%|\n|2023-01|13,000|12,000|+8.3%|\n|2023-02|14,000|12,000|+16.7%|\n|2023-03|15,000|12,000|+25%|";
2
+ //# sourceMappingURL=last.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"last.d.ts","sourceRoot":"","sources":["../../../../../../../src/docs/en/docs/create-metrics/maql/aggregation/last.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,4oFAmES,CAAC"}
@@ -0,0 +1,69 @@
1
+ // (C) 2021-2026 GoodData Corporation
2
+ export const content = `# LAST_VALUE
3
+ The \`LAST_VALUE\` function returns the last value of a sequence.
4
+
5
+ The function is typically used to determine the last value of semi-additive fact when used together with sum aggregation.
6
+
7
+ ## Syntax
8
+
9
+ \`\`\`
10
+ SELECT LAST_VALUE({numeric})
11
+ ORDER BY {attribute/label} [ASC|DESC]
12
+ [WITHIN (... | CURRENT)]
13
+
14
+ \`\`\`
15
+
16
+ The argument of the function is a metric or a subselect defining an aggregation.
17
+
18
+ > If you use facts, make sure that the fact has only a single value defined for each \`ORDER BY\` attribute.
19
+
20
+ The sequence is determined by the attribute in \`ORDER BY\`. The metric is broken down by the given attribute and the results are displayed in the ascending order by default.
21
+
22
+ > To show the result in the descending order, use the DESC directive.
23
+ >
24
+ > \`NULL\` values are considered as the smallest values.
25
+
26
+ If the metric is broken down by other attributes, these attributes define a partition in which the last value is being determined.
27
+
28
+ Use the \`WITHIN\` keyword to avoid this behavior and use the common last value for all the values of the given attributes.
29
+
30
+ > See also [FIRST_VALUE](https://www.gooddata.com/developers/cloud-native/doc/hosted/create-metrics/maql/aggregation/first/) for additional information.
31
+
32
+ ## Examples
33
+
34
+ The last value of a sum of semi-additive snapshots from a dataset with daily snapshots.
35
+
36
+ Example of such a semi-additive snapshot can be **account balance** (values of multiple accounts can be summed up but not their daily snapshots).
37
+
38
+ \`\`\`
39
+ SELECT LAST_VALUE(SUM({fact/snapshot_value})) ORDER BY {attribute/date.day}
40
+ \`\`\`
41
+
42
+ To show how much your account balance has grown since the beginning of the year, you can use the following metrics and syntax:
43
+
44
+ | Metric | Syntax |
45
+ | --- | --- |
46
+ | last_day_value | \`SELECT LAST_VALUE(SUM({fact/snapshot_value})) ORDER BY {attribute/date.day}\` |
47
+ | first_day_value_in_year | \`SELECT FIRST_VALUE(SUM({fact/snapshot_value})) ORDER BY {attribute/date.day} WITHIN ({attribute/date.year})\` |
48
+ | growth_to_date | \`SELECT {metric/last_day_value}/{metric/first_day_value_in_year}-1\` |
49
+
50
+ </br>
51
+ The result may look as follows:
52
+
53
+ | Date - Month/Year| last_day_value | first_day_value_in_year | growth_to_date |
54
+ | --- | --- | --- | --- |
55
+ |2022-01|1,000|1,000|0%|
56
+ |2022-02|2,000|1,000|+100%|
57
+ |2022-03|3,000|1,000|+200%|
58
+ |2022-04|4,000|1,000|+300%|
59
+ |2022-05|5,000|1,000|+400%|
60
+ |2022-06|6,000|1,000|+500%|
61
+ |2022-07|7,000|1,000|+600%|
62
+ |2022-08|8,000|1,000|+700%|
63
+ |2022-09|9,000|1,000|+800%|
64
+ |2022-10|10,000|1,000|+900%|
65
+ |2022-11|11,000|1,000|+1000%|
66
+ |2022-12|12,000|1,000|+1100%|
67
+ |2023-01|13,000|12,000|+8.3%|
68
+ |2023-02|14,000|12,000|+16.7%|
69
+ |2023-03|15,000|12,000|+25%|`;
@@ -0,0 +1,2 @@
1
+ export declare const content = "# MAX\n## Metrics\n\nThe MAX function returns the maximum value of all numbers in the set\n(e.g., Salary Paid).\n\n### Syntax\n\n```\nSELECT MAX(\u2026)\nSELECT MAX(fact)\n```\n\n### Example\n\nThe MAX of the Store Sales fact is the highest sales transaction value on record:\n\n```\nSELECT MAX({fact/sales})\n```\n\n## Attributes\n\nThe MAX function can be also used to determine the maximum value of attributes with non-numeric data types (e.g. string or date attributes). \n\nThe results cannot be displayed in insights directly, but they can be used in conditional filtering, for example, to filter the last snapshot.\n\n### Syntax\n\n```\nSELECT MAX(attribute)\nSELECT MAX(attribute,primary_key)\nSELECT MAX(attribute,dataset)\nSELECT MAX(attribute) USING attribute\n```\n\nIf the attribute is referenced from multiple fact datasets, use two parameters in the MAX function. \n\nThe context where to search for maximum value of the attribute is determined by the second parameter - the primary key of the dataset or the dataset identifier. \n\nFor date attributes, use the second attribute or the USING keyword.\n\n### Examples\n\nThe sum of semi-additive snapshot values for the last of the daily snapshots. \n\n```\nSELECT SUM({fact/snapshot_value}) \nWHERE {attribute/snapshot_date.day} =\n (SELECT MAX({attribute/snapshot_date.day},{dataset/fact_dataset}))\n```\n\nIf the metric is broken down by other attributes and displayed as a table, the maximum value can be different for each row. \n\nTo use the maximum date for all rows, add `BY ALL OTHER` to the syntax.\n```\nSELECT SUM({fact/snapshot_value}) \nWHERE {attribute/snapshot_date.day} =\n (SELECT MAX({attribute/snapshot_date.day},{dataset/fact_dataset}) BY ALL OTHER)\n```";
2
+ //# sourceMappingURL=max.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"max.d.ts","sourceRoot":"","sources":["../../../../../../../src/docs/en/docs/create-metrics/maql/aggregation/max.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,2tDA2Db,CAAC"}
@@ -0,0 +1,61 @@
1
+ // (C) 2021-2026 GoodData Corporation
2
+ export const content = `# MAX
3
+ ## Metrics
4
+
5
+ The MAX function returns the maximum value of all numbers in the set
6
+ (e.g., Salary Paid).
7
+
8
+ ### Syntax
9
+
10
+ \`\`\`
11
+ SELECT MAX(…)
12
+ SELECT MAX(fact)
13
+ \`\`\`
14
+
15
+ ### Example
16
+
17
+ The MAX of the Store Sales fact is the highest sales transaction value on record:
18
+
19
+ \`\`\`
20
+ SELECT MAX({fact/sales})
21
+ \`\`\`
22
+
23
+ ## Attributes
24
+
25
+ The MAX function can be also used to determine the maximum value of attributes with non-numeric data types (e.g. string or date attributes).
26
+
27
+ The results cannot be displayed in insights directly, but they can be used in conditional filtering, for example, to filter the last snapshot.
28
+
29
+ ### Syntax
30
+
31
+ \`\`\`
32
+ SELECT MAX(attribute)
33
+ SELECT MAX(attribute,primary_key)
34
+ SELECT MAX(attribute,dataset)
35
+ SELECT MAX(attribute) USING attribute
36
+ \`\`\`
37
+
38
+ If the attribute is referenced from multiple fact datasets, use two parameters in the MAX function.
39
+
40
+ The context where to search for maximum value of the attribute is determined by the second parameter - the primary key of the dataset or the dataset identifier.
41
+
42
+ For date attributes, use the second attribute or the USING keyword.
43
+
44
+ ### Examples
45
+
46
+ The sum of semi-additive snapshot values for the last of the daily snapshots.
47
+
48
+ \`\`\`
49
+ SELECT SUM({fact/snapshot_value})
50
+ WHERE {attribute/snapshot_date.day} =
51
+ (SELECT MAX({attribute/snapshot_date.day},{dataset/fact_dataset}))
52
+ \`\`\`
53
+
54
+ If the metric is broken down by other attributes and displayed as a table, the maximum value can be different for each row.
55
+
56
+ To use the maximum date for all rows, add \`BY ALL OTHER\` to the syntax.
57
+ \`\`\`
58
+ SELECT SUM({fact/snapshot_value})
59
+ WHERE {attribute/snapshot_date.day} =
60
+ (SELECT MAX({attribute/snapshot_date.day},{dataset/fact_dataset}) BY ALL OTHER)
61
+ \`\`\``;
@@ -0,0 +1,2 @@
1
+ export declare const content = "# MEDIAN\nThe MEDIAN function counts the statistical median - an order statistic\nthat gives the middle value of a sample. If the middle falls between two\nvalues, the function returns average of the two middle values. Null\nvalues are ignored.\n\nThe MEDIAN function is especially useful in cases where a small set of\noutliers could drastically skew the average if calculated as a mean.\n\n## Syntax\n\n```\nSELECT MEDIAN(\u2026)\nMEDIAN(fact)\nMEDIAN(metric)\nMEDIAN(metric_expression)\n```\n\n## Examples\n\n```\nSELECT MEDIAN({fact/cost}) BY ALL OTHER\nSELECT MEDIAN({metric/payment}) BY {attribute/customer}\n```";
2
+ //# sourceMappingURL=median.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"median.d.ts","sourceRoot":"","sources":["../../../../../../../src/docs/en/docs/create-metrics/maql/aggregation/median.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,+mBAuBb,CAAC"}
@@ -0,0 +1,25 @@
1
+ // (C) 2021-2026 GoodData Corporation
2
+ export const content = `# MEDIAN
3
+ The MEDIAN function counts the statistical median - an order statistic
4
+ that gives the middle value of a sample. If the middle falls between two
5
+ values, the function returns average of the two middle values. Null
6
+ values are ignored.
7
+
8
+ The MEDIAN function is especially useful in cases where a small set of
9
+ outliers could drastically skew the average if calculated as a mean.
10
+
11
+ ## Syntax
12
+
13
+ \`\`\`
14
+ SELECT MEDIAN(…)
15
+ MEDIAN(fact)
16
+ MEDIAN(metric)
17
+ MEDIAN(metric_expression)
18
+ \`\`\`
19
+
20
+ ## Examples
21
+
22
+ \`\`\`
23
+ SELECT MEDIAN({fact/cost}) BY ALL OTHER
24
+ SELECT MEDIAN({metric/payment}) BY {attribute/customer}
25
+ \`\`\``;
@@ -0,0 +1,2 @@
1
+ export declare const content = "# MIN\n## Metrics\n\nThe MIN function returns the minimum value of all numbers in the set\n(e.g., Salary Paid).\n\n### Syntax\n\n```\nSELECT MIN(\u2026)\nSELECT MIN(fact)\n```\n\n### Example\n\nThe MIN of the *Opportunity Amount* fact is the lowest opportunity\namount value on record:\n\n```\nSELECT MIN({fact/opportunity_amount})\n```\n\n## Attributes\n\nThe MIN function can be also used to determine the minimum value of attributes with non-numeric data types (e.g. string or date attributes). \n\nThe results cannot be displayed in insights directly, but they can be used in conditional filtering, for example, to filter the last snapshot.\n\n### Syntax\n\n```\nSELECT MIN(attribute)\nSELECT MIN(attribute,primary_key)\nSELECT MIN(attribute,dataset)\nSELECT MIN(attribute) USING attribute\n```\n\nIf the attribute is referenced from multiple fact datasets, use two parameters in the MIN function. \n\nThe context where to search for minimum value of the attribute is determined by the second parameter - the primary key of the dataset or the dataset identifier. \n\nFor date attributes, use the second attribute or the USING keyword.\n\n### Examples\n\nThe sum of semi-additive snapshot values for the first of the daily snapshots. \n\n```\nSELECT SUM({fact/snapshot_value}) \nWHERE {attribute/snapshot_date.day} =\n (SELECT MIN({attribute/snapshot_date.day},{dataset/fact_dataset}))\n```\n\n\nIf the metric is broken down by other attributes and displayed as a table, the minimum value can be different for each row. \n\nTo use the minimum date for all rows, add `BY ALL OTHER` to the syntax.\n```\nSELECT SUM({fact/snapshot_value}) \nWHERE {attribute/snapshot_date.day} =\n (SELECT MIN({attribute/snapshot_date.day},{dataset/fact_dataset}) BY ALL OTHER)\n```";
2
+ //# sourceMappingURL=min.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"min.d.ts","sourceRoot":"","sources":["../../../../../../../src/docs/en/docs/create-metrics/maql/aggregation/min.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,qvDA6Db,CAAC"}
@@ -0,0 +1,63 @@
1
+ // (C) 2021-2026 GoodData Corporation
2
+ export const content = `# MIN
3
+ ## Metrics
4
+
5
+ The MIN function returns the minimum value of all numbers in the set
6
+ (e.g., Salary Paid).
7
+
8
+ ### Syntax
9
+
10
+ \`\`\`
11
+ SELECT MIN(…)
12
+ SELECT MIN(fact)
13
+ \`\`\`
14
+
15
+ ### Example
16
+
17
+ The MIN of the *Opportunity Amount* fact is the lowest opportunity
18
+ amount value on record:
19
+
20
+ \`\`\`
21
+ SELECT MIN({fact/opportunity_amount})
22
+ \`\`\`
23
+
24
+ ## Attributes
25
+
26
+ The MIN function can be also used to determine the minimum value of attributes with non-numeric data types (e.g. string or date attributes).
27
+
28
+ The results cannot be displayed in insights directly, but they can be used in conditional filtering, for example, to filter the last snapshot.
29
+
30
+ ### Syntax
31
+
32
+ \`\`\`
33
+ SELECT MIN(attribute)
34
+ SELECT MIN(attribute,primary_key)
35
+ SELECT MIN(attribute,dataset)
36
+ SELECT MIN(attribute) USING attribute
37
+ \`\`\`
38
+
39
+ If the attribute is referenced from multiple fact datasets, use two parameters in the MIN function.
40
+
41
+ The context where to search for minimum value of the attribute is determined by the second parameter - the primary key of the dataset or the dataset identifier.
42
+
43
+ For date attributes, use the second attribute or the USING keyword.
44
+
45
+ ### Examples
46
+
47
+ The sum of semi-additive snapshot values for the first of the daily snapshots.
48
+
49
+ \`\`\`
50
+ SELECT SUM({fact/snapshot_value})
51
+ WHERE {attribute/snapshot_date.day} =
52
+ (SELECT MIN({attribute/snapshot_date.day},{dataset/fact_dataset}))
53
+ \`\`\`
54
+
55
+
56
+ If the metric is broken down by other attributes and displayed as a table, the minimum value can be different for each row.
57
+
58
+ To use the minimum date for all rows, add \`BY ALL OTHER\` to the syntax.
59
+ \`\`\`
60
+ SELECT SUM({fact/snapshot_value})
61
+ WHERE {attribute/snapshot_date.day} =
62
+ (SELECT MIN({attribute/snapshot_date.day},{dataset/fact_dataset}) BY ALL OTHER)
63
+ \`\`\``;
@@ -0,0 +1,2 @@
1
+ export declare const content = "# SUM\nThe SUM function returns a sum of all numbers in the set (e.g., Salary\nPaid).\n\n## Syntax\n\n```\nSELECT SUM(\u2026)\nSELECT SUM(fact)\n```\n\n## Examples\n\nThe metric defined by the SUM of the *Sales* fact would be computed by\nadding revenue earned from all individual sales transactions: \n\n```\nSELECT SUM({fact/sales})\n```";
2
+ //# sourceMappingURL=sum.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sum.d.ts","sourceRoot":"","sources":["../../../../../../../src/docs/en/docs/create-metrics/maql/aggregation/sum.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,wVAkBb,CAAC"}
@@ -0,0 +1,20 @@
1
+ // (C) 2021-2026 GoodData Corporation
2
+ export const content = `# SUM
3
+ The SUM function returns a sum of all numbers in the set (e.g., Salary
4
+ Paid).
5
+
6
+ ## Syntax
7
+
8
+ \`\`\`
9
+ SELECT SUM(…)
10
+ SELECT SUM(fact)
11
+ \`\`\`
12
+
13
+ ## Examples
14
+
15
+ The metric defined by the SUM of the *Sales* fact would be computed by
16
+ adding revenue earned from all individual sales transactions:
17
+
18
+ \`\`\`
19
+ SELECT SUM({fact/sales})
20
+ \`\`\``;
@@ -0,0 +1,2 @@
1
+ export declare const content = "# CASE\nCASE is a conditional statement that performs logical tests on a series\nof conditions and returns values when a condition is met. The CASE\nfunction returns a numeric result. You use CASE for complex conditional\nexpressions that contain two or more conditions.\n\nCASE is followed by WHEN/THEN keywords to specify the conditions, then\nby ELSE to specify the default return.\n\nIf no match is found, the default return expression (ELSE) is used. If\nthere is no default return and no values match, then `null` value is returned.\nAll CASE expressions conclude with the END keyword.\n\n## CASE and Multidimensionality\n\nBefore proceeding to the CASE syntax samples, as a user you have to\nunderstand that usage guidelines for CASE in the MAQL environment are based on multidimensionality. Understanding multidimensionality is crucial to\nensure your CASE metrics return correct results (see [MAQL and Multidimensionality](https://www.gooddata.com/developers/cloud-native/doc/hosted/create-metrics/maql/maql-and-multidimensionality/)).\n\n- CASE does not work with the base data level.\n- Instead, the condition is evaluated on the aggregation dimension.\n- All WHENs are evaluated independently but all based on a single\n dimension (the aggregation dimension mentioned in the previous\n point).\n\nIn most common scenarios you should follow this rule:\n\n- Always put the CASE statement inside (not outside) an aggregation (SUM) container.\n\nSee examples below.\n\n## CASE Syntax\n\nCASE can be used in the following two syntax forms:\n\n\n| Form | Syntax | Example|\n|-----------------|------------------|--------------|\n| No aggregation | `SELECT CASE WHEN condition1 THEN outcome1, WHEN condition2 THEN outcome 2 ELSE outcome3 END` | `SELECT CASE WHEN {attribute/activity_type} IN (\"email\", \"meeting\") THEN 1, WHEN {attribute/activity_type} IN (\"phone_call\") THEN 2 ELSE 0 END`|\n|With aggregation |`SELECT SUM (SELECT CASE WHEN condition1 THEN outcome1, WHEN condition2 THEN outcome2 ELSE outcome3 END)` | `SELECT SUM (SELECT CASE WHEN {attribute/activity_type} IN (\"email\", \"meeting\") THEN {fact/amount} ELSE {fact/loss} END)` |\n\nUsing the aggregation container ensures that the CASE conditions are\ncomputed on the correct dimension and returns relevant results.\n\n## How to Use CASE Correctly\n\nAs noted above, we advise you to use CASE inside aggregation containers.\n\nHere is an example of incorrect use of CASE in the following logical\ndata model. For the sake brevity, only one CASE condition is used.\n\n![An example of incorrect use of CASE ](https://www.gooddata.com/developers/cloud-native/doc/maql/case.png)\n\nIf you want to slice the following metric with **Campaign Category**,\nthe visualization would not compute because the WHEN conditions are not\nrelated to visualization dimensionality:\n\n```\nSELECT CASE WHEN {fact/customer_state} IN (\"AR\", \"NY\") THEN SUM ({fact/price}) ELSE SUM({fact/price} * {fact/quantity}) END\n```\n\nOn the other hand, the same metric when sliced by attribute **Customer\nID** (instead of **Campaign Category**) is valid. That is because the\nslicing attribute (**Customer ID**) is directly related to the CASE\ncondition attribute (Customer State).\n\nIf you need to slice by unrelated attribute, put the CASE statement\ninside the SUM aggregation instead:\n\n```\nSELECT SUM(SELECT CASE WHEN {attribute/customer_state} IN (\"AR\", \"NY\") THEN {fact/price} ELSE {fact/price} * {fact/quantity} END)\n```";
2
+ //# sourceMappingURL=case.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"case.d.ts","sourceRoot":"","sources":["../../../../../../../src/docs/en/docs/create-metrics/maql/conditionals/case.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,49GAuEb,CAAC"}
@@ -0,0 +1,73 @@
1
+ // (C) 2021-2026 GoodData Corporation
2
+ export const content = `# CASE
3
+ CASE is a conditional statement that performs logical tests on a series
4
+ of conditions and returns values when a condition is met. The CASE
5
+ function returns a numeric result. You use CASE for complex conditional
6
+ expressions that contain two or more conditions.
7
+
8
+ CASE is followed by WHEN/THEN keywords to specify the conditions, then
9
+ by ELSE to specify the default return.
10
+
11
+ If no match is found, the default return expression (ELSE) is used. If
12
+ there is no default return and no values match, then \`null\` value is returned.
13
+ All CASE expressions conclude with the END keyword.
14
+
15
+ ## CASE and Multidimensionality
16
+
17
+ Before proceeding to the CASE syntax samples, as a user you have to
18
+ understand that usage guidelines for CASE in the MAQL environment are based on multidimensionality. Understanding multidimensionality is crucial to
19
+ ensure your CASE metrics return correct results (see [MAQL and Multidimensionality](https://www.gooddata.com/developers/cloud-native/doc/hosted/create-metrics/maql/maql-and-multidimensionality/)).
20
+
21
+ - CASE does not work with the base data level.
22
+ - Instead, the condition is evaluated on the aggregation dimension.
23
+ - All WHENs are evaluated independently but all based on a single
24
+ dimension (the aggregation dimension mentioned in the previous
25
+ point).
26
+
27
+ In most common scenarios you should follow this rule:
28
+
29
+ - Always put the CASE statement inside (not outside) an aggregation (SUM) container.
30
+
31
+ See examples below.
32
+
33
+ ## CASE Syntax
34
+
35
+ CASE can be used in the following two syntax forms:
36
+
37
+
38
+ | Form | Syntax | Example|
39
+ |-----------------|------------------|--------------|
40
+ | No aggregation | \`SELECT CASE WHEN condition1 THEN outcome1, WHEN condition2 THEN outcome 2 ELSE outcome3 END\` | \`SELECT CASE WHEN {attribute/activity_type} IN ("email", "meeting") THEN 1, WHEN {attribute/activity_type} IN ("phone_call") THEN 2 ELSE 0 END\`|
41
+ |With aggregation |\`SELECT SUM (SELECT CASE WHEN condition1 THEN outcome1, WHEN condition2 THEN outcome2 ELSE outcome3 END)\` | \`SELECT SUM (SELECT CASE WHEN {attribute/activity_type} IN ("email", "meeting") THEN {fact/amount} ELSE {fact/loss} END)\` |
42
+
43
+ Using the aggregation container ensures that the CASE conditions are
44
+ computed on the correct dimension and returns relevant results.
45
+
46
+ ## How to Use CASE Correctly
47
+
48
+ As noted above, we advise you to use CASE inside aggregation containers.
49
+
50
+ Here is an example of incorrect use of CASE in the following logical
51
+ data model. For the sake brevity, only one CASE condition is used.
52
+
53
+ ![An example of incorrect use of CASE ](https://www.gooddata.com/developers/cloud-native/doc/maql/case.png)
54
+
55
+ If you want to slice the following metric with **Campaign Category**,
56
+ the visualization would not compute because the WHEN conditions are not
57
+ related to visualization dimensionality:
58
+
59
+ \`\`\`
60
+ SELECT CASE WHEN {fact/customer_state} IN ("AR", "NY") THEN SUM ({fact/price}) ELSE SUM({fact/price} * {fact/quantity}) END
61
+ \`\`\`
62
+
63
+ On the other hand, the same metric when sliced by attribute **Customer
64
+ ID** (instead of **Campaign Category**) is valid. That is because the
65
+ slicing attribute (**Customer ID**) is directly related to the CASE
66
+ condition attribute (Customer State).
67
+
68
+ If you need to slice by unrelated attribute, put the CASE statement
69
+ inside the SUM aggregation instead:
70
+
71
+ \`\`\`
72
+ SELECT SUM(SELECT CASE WHEN {attribute/customer_state} IN ("AR", "NY") THEN {fact/price} ELSE {fact/price} * {fact/quantity} END)
73
+ \`\`\``;
@@ -0,0 +1,2 @@
1
+ export declare const content = "# IF THEN ELSE\nIF THEN ELSE construct is a simplified version of CASE statement: \n\n```\nSELECT IF condition THEN expression ELSE expression END\n```\nis equivalent to\n```\nSELECT CASE WHEN condition THEN expression ELSE expression END\n```\n\nFor the detailed discussion of the semantics see [CASE statement](https://www.gooddata.com/developers/cloud-native/doc/hosted/create-metrics/maql/conditionals/case/).\n\n## Syntax\n\n```\nSELECT IF \u2026 THEN \u2026 ELSE \u2026 END\nSELECT IF condition THEN number ELSE number END\nSELECT IF condition THEN arithmetic_operation ELSE arithmetic_operation END\n```\n\n## Examples\n\n```\nSELECT IF SUM({fact/amount})>= AVG({fact/amount}) THEN 10 ELSE 0 END\nSELECT IF SUM({fact/duration}) - AVG({fact/duration}) > 2000 THEN 0 ELSE 1 END\nSELECT IF AVG({fact/probability}) > 0.5 THEN SUM({fact/amount}) * 10 ELSE SUM({fact/amount}) / 10 END\n```";
2
+ //# sourceMappingURL=if-then-else.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"if-then-else.d.ts","sourceRoot":"","sources":["../../../../../../../src/docs/en/docs/create-metrics/maql/conditionals/if-then-else.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,g4BA2Bb,CAAC"}
@@ -0,0 +1,29 @@
1
+ // (C) 2021-2026 GoodData Corporation
2
+ export const content = `# IF THEN ELSE
3
+ IF THEN ELSE construct is a simplified version of CASE statement:
4
+
5
+ \`\`\`
6
+ SELECT IF condition THEN expression ELSE expression END
7
+ \`\`\`
8
+ is equivalent to
9
+ \`\`\`
10
+ SELECT CASE WHEN condition THEN expression ELSE expression END
11
+ \`\`\`
12
+
13
+ For the detailed discussion of the semantics see [CASE statement](https://www.gooddata.com/developers/cloud-native/doc/hosted/create-metrics/maql/conditionals/case/).
14
+
15
+ ## Syntax
16
+
17
+ \`\`\`
18
+ SELECT IF … THEN … ELSE … END
19
+ SELECT IF condition THEN number ELSE number END
20
+ SELECT IF condition THEN arithmetic_operation ELSE arithmetic_operation END
21
+ \`\`\`
22
+
23
+ ## Examples
24
+
25
+ \`\`\`
26
+ SELECT IF SUM({fact/amount})>= AVG({fact/amount}) THEN 10 ELSE 0 END
27
+ SELECT IF SUM({fact/duration}) - AVG({fact/duration}) > 2000 THEN 0 ELSE 1 END
28
+ SELECT IF AVG({fact/probability}) > 0.5 THEN SUM({fact/amount}) * 10 ELSE SUM({fact/amount}) / 10 END
29
+ \`\`\``;
@@ -0,0 +1,2 @@
1
+ export declare const content = "# IFNULL\nIFNULL statement allows you to control replacement of missing values that are returned by an expression.\n\nIf a metric expression that is wrapped within an IFNULL statement ever returns a null value, the replacement number specified in the second parameter of the IFNULL function is inserted in place of the null value.\n\nIFNULL is useful especially in cases where a sub-metric is referred to within another metric's definition. Wrapping the sub metric in an IFNULL statement keeps the encompassing metric from becoming null due to one of its components returning a null value. \n\n## Syntax\n\n```\nSELECT IFNULL(\u2026,\u2026)\nSELECT IFNULL(metric, replacement_value)\n```\n\n## Examples\n\n```\nSELECT IFNULL(SUM({fact/amount}), 0)\nSELECT IFNULL(SUM({metric/fb_cost} + {metric/tw_cost}), 0)\nSELECT IFNULL(SUM({fact/amount}) + 100, 1)\n```\n\nSupported replacement values include constants, but not other metric expressions.\n\n## IFNULL Best Practices\n\nThe IFNULL function is used to replace missing values in fact tables and to replace values when a computation generates a null value.\n\nA null value is not the same thing as zero (0). A null value means one of the following:\n\n- no entry has been made\n- the value is unknown\n\nThe IFNULL function can be useful for handling or trapping values that are null, which can confuse your analysis.\n\nHowever, the function should not be overused, as it can add significant computing time and consume workspace computational bandwidth.\n\nDo not apply IFNULL to all of your functions or even your basic sum, average, and count functions. Instead, use IFNULL where the presence of null values is causing confusion or ambiguity in the visualizations you have created.\n\nWrapping a metric in the IFNULL statement enables operations where one of the values is null. The syntax for this statement looks like the following:\n\n```\nSELECT IFNULL(metric_reference, replacement_value)\n```\n\nThe IFNULL function can be applied to facts, too.\n\n```\nSELECT IFNULL(fact_name, replacement_value)\n```\n\n**Example - Data with a missing line item**\n\nAn IFNULL does not mean that there is a blank or missing line item.\n\nSuppose your data looks like the following:\n\n |Date | Sales Amounts|\n |------------| ---------------|\n |08/01/2013 | $3,000|\n |08/02/2013 | $5,700|\n |08/03/2013 | $2,000|\n |08/05/2013 | $4,400|\n\nWrapping the `Sales Amount` metric in an IFNULL function does not make data for 08/04/2013 appear because there isn't any data for that day.\n\nThe IFNULL function does not populate rows of data when the row does not exist. Instead, IFNULL forces a value to appear when the value is blank.\n\n**Example - IFNULL and arithmetic operations**\n\nThe prime example of when to use IFNULL is when you are performing an arithmetic operation, and one of the values could potentially be null.\n\nSuppose you have different types of transactions: payments, refunds, and partial refunds. You have two metrics to measure payments ( `# Payments` ) and refunds ( `# Refunds` ):\n\n```\nSELECT COUNT({attribute/transaction_id}) WHERE {attribute/transaction_type} = \"Sale\"\nSELECT COUNT({attribute/transaction_id}) WHERE {attribute/transaction_type} IN (\"Full Refund\", \"Partial Refund\")\n```\n\nNow, suppose your daily analysis calculates the difference between the number of payments received and the refunds processed. The difference metric should look like the following:\n\n```\nSELECT {metric/no_of_payments} - {metric/no_of_refunds}\n```\n\nHowever, your enterprise does not process refunds every day. If no refunds are processed for a day, the above metric generates a null value, even if there are payments.\n\nIf one of the values within an expression is null, the entire expression is null. Use `IFNULL` to preserve the computation.\n\nTo solve this problem, you would wrap the expressions in the IFNULL function like the following:\n\n```\nSELECT IFNULL({metric/no_of_payments},0) - IFNULL({metric/no_of_refunds},0)\n```\nIf a refund was not processed for the day, the calculation can still be performed.";
2
+ //# sourceMappingURL=ifnull.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ifnull.d.ts","sourceRoot":"","sources":["../../../../../../../src/docs/en/docs/create-metrics/maql/conditionals/ifnull.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,shIA8F+D,CAAC"}