CALC_CROP


Applies to: CELONIS 4.0 CELONIS 4.2 CELONIS 4.3 CELONIS 4.4

Description

This operator crops cases to a range of activities. All values outside this range are mapped to null. Values within the range are flagged with 1, in contrast to CALC_CROP which returns the input values.

Этот оператор обрабатывает случаи для ряда видов деятельности. Все значения за пределами этого диапазона отображаются на ноль. Значения в диапазоне помечены 1, в отличие от CALC_CROP, который возвращает входные значения.

Syntax


CALC_CROP ( begin_range_specifier TO end_range_specifier, table.column )

  • begin_range_specifier: CASE_START | FIRST_OCCURRENCE [ activity_name ] | LAST_OCCURRENCE [ activity_name ]
  • end_range_specifier: CASE_END | FIRST_OCCURRENCE [ activity_name ] | LAST_OCCURRENCE [ activity_name ]
  • column: Any string column which can be joined to the activity table
Любой строковый столбец, который можно присоединить к таблице активности

Range Specifier

  • FIRST_OCCURRENCE['activity_name']: First occurrence of the specified activity type.
Первое вхождение указанного вида деятельности.
  • LAST_OCCURRENCE['activity_name']: Last occurrence of the specified activity type.
Последнее вхождение указанного вида деятельности.
  • CASE_START: Range begins at the start of the case.
Диапазон начинается в начале дела.
  • CASE_END: Range ends at the end of the case
Диапазон заканчивается в конце дела

Examples

Simple example with one matching (In case 1 B comes before C) and one not matching (In case 2 there is no C after B) case.
Простой пример с одним подходящим (в случае 1 B предшествует C) и одним не соответствующим (в случае 2 нет C после B) case.
Query
Column1

CALC_CROP(FIRST_OCCURRENCE [ 'B' ] TO LAST_OCCURRENCE ['C'], "Table1"."activity")

Input
Table1

case : INT
activity : STRING
timestamp : DATE
1
'A'
Mon Feb 01 2016 01:00:00.000
1
'B'
Mon Feb 01 2016 02:00:00.000
1
'C'
Mon Feb 01 2016 03:00:00.000
1
'D'
Mon Feb 01 2016 04:00:00.000
2
'A'
Mon Feb 01 2016 01:00:00.000
2
'B'
Mon Feb 01 2016 02:00:00.000
2
'D'
Mon Feb 01 2016 03:00:00.000
2
'E'
Mon Feb 01 2016 04:00:00.000

Output
Result

Column1 : INT
null
1
1
null
null
null
null
null




If range specifiers are conflicting, e.g. end activity is before start activity the complete case is mapped to null.
Если спецификаторы диапазона конфликтуют, например, конечное действие перед началом действия, полный случай отображается на ноль.
Query
Column1

CALC_CROP(FIRST_OCCURRENCE [ 'C' ] TO LAST_OCCURRENCE ['B'], "Table1"."activity")

Input
Table1

case : INT
activity : STRING
timestamp : DATE
1
'A'
Mon Feb 01 2016 01:00:00.000
1
'B'
Mon Feb 01 2016 02:00:00.000
1
'C'
Mon Feb 01 2016 03:00:00.000
1
'D'
Mon Feb 01 2016 04:00:00.000

Output
Result

Column1 : INT
null
null
null
null




Example for FIRST_OCCURRENCE and LAST_OCCURRENCE if activities appear multiple times
Пример для FIRST_OCCURRENCE и LAST_OCCURRENCE, если действия появляются несколько раз
Query
Column1

CALC_CROP(LAST_OCCURRENCE [ 'A' ] TO FIRST_OCCURRENCE ['B'], "Table1"."activity")

Input
Table1

case : INT
activity : STRING
timestamp : DATE
1
'A'
Mon Feb 01 2016 01:00:00.000
1
'A'
Mon Feb 01 2016 02:00:00.000
1
'B'
Mon Feb 01 2016 03:00:00.000
1
'B'
Mon Feb 01 2016 04:00:00.000

Output
Result

Column1 : INT
null
1
1
null




Example how CASE_START and CASE_END can be applied. They can also be mixed LAST_OCCURRENCE and FIRST_OCCURRENCE.
Пример применения CASE_START и CASE_END. Они также могут быть смешаны LAST_OCCURRENCE и FIRST_OCCURRENCE.
Query
Column1

CALC_CROP(CASE_START TO CASE_END, "Table1"."activity")

Input
Table1

case : INT
activity : STRING
timestamp : DATE
1
'A'
Mon Feb 01 2016 01:00:00.000
1
'A'
Mon Feb 01 2016 02:00:00.000
1
'B'
Mon Feb 01 2016 03:00:00.000
1
'B'
Mon Feb 01 2016 04:00:00.000

Output
Result

Column1 : INT
1
1
1
1




Example how through using REMAP_VALUES, CALC_CROP can be used to crop to the last occurrence of B or C.
Пример того, как с помощью REMAP_VALUES можно использовать CALC_CROP для обрезки до последнего вхождения B или C.
Query
Column1

CALC_CROP(FIRST_OCCURRENCE [ 'A' ] TO LAST_OCCURRENCE ['Z'], REMAP_VALUES("Table1"."activity", ['B', 'Z'], ['C', 'Z']))

Input
Table1

case : INT
activity : STRING
timestamp : DATE
1
'A'
Mon Feb 01 2016 01:00:00.000
1
'B'
Mon Feb 01 2016 02:00:00.000
1
'C'
Mon Feb 01 2016 03:00:00.000
1
'D'
Mon Feb 01 2016 04:00:00.000

Output
Result

Column1 : INT
1
1
1
null





Содержание

  1. Data Types
  2. DATE
  3. FLOAT
  4. INT
  5. STRING
  6. Functions
  7. Aggregation Functions
  8. GLOBAL
  9. Pull Up Aggregation Functions
  10. PU_AVG
  11. PU_COUNT
  12. PU_COUNT_DISTINCT
  13. PU_FIRST
  14. PU_LAST
  15. PU_MAX
  16. PU_MEDIAN
  17. PU_MIN
  18. PU_QUANTILE
  19. PU_SUM
  20. Standard Aggregation Functions
  21. AVG
  22. COUNT
  23. COUNT_TABLE
  24. COUNT DISTINCT
  25. MAX
  26. MEDIAN
  27. MIN
  28. QUANTILE
  29. STDEV
  30. SUM
  31. TRIMMED_MEAN
  32. VAR
  33. Moving Aggregation Functions
  34. MOVING_AVG
  35. MOVING_COUNT
  36. MOVING_COUNT_DISTINCT
  37. MOVING_MAX
  38. MOVING_MEDIAN
  39. MOVING_MIN
  40. MOVING_STDEV
  41. MOVING_SUM
  42. MOVING_TRIMMED_MEAN
  43. RUNNING_TOTAL
  44. HOUR_NOW
  45. TODAY
  46. DATE_BETWEEN
  47. DAYS_BETWEEN
  48. HOURS_BETWEEN
  49. MILLIS_BETWEEN
  50. MINUTES_BETWEEN
  51. MONTHS_BETWEEN
  52. SECONDS_BETWEEN
  53. WORKDAYS_BETWEEN
  54. YEARS_BETWEEN
  55. ADD_DAYS
  56. ADD_HOURS
  57. ADD_MILLIS
  58. ADD_MINUTES
  59. ADD_MONTHS
  60. ADD_SECONDS
  61. ADD_WORKDAYS
  62. ADD_YEARS
  63. CALENDAR_WEEK
  64. DATE_MATCH
  65. DAY
  66. DAY_OF_WEEK
  67. HOURS
  68. MILLIS
  69. MINUTES
  70. MONTH
  71. QUARTER
  72. REMAP_TIMESTAMP
  73. SECONDS
  74. TO_TIMESTAMP
  75. YEAR
  76. DateTime Rounding Functions
  77. ROUND_DAY
  78. ROUND_HOUR
  79. ROUND_MINUTE
  80. ROUND_MONTH
  81. ROUND_QUARTER
  82. ROUND_SECOND
  83. ROUND_WEEK
  84. ROUND_YEAR
  85. DECISION_TREE
  86. KMEANS
  87. LINEAR_REGRESSION
  88. Math Functions
  89. ABC
  90. ABS
  91. CEIL
  92. FLOOR
  93. LOG
  94. POWER
  95. ROUND
  96. SQRT
  97. SQUARE
  98. ISNULL
  99. Process Functions
  100. ACTIVATION_COUNT
  101. CALC_CROP
  102. CALC_CROP_TO_NULL
  103. CALC_REWORK
  104. CALC_THROUGHPUT
  105. MATCH_PROCESS
  106. PROCESS_ORDER
  107. PROCESS EQUALS
  108. SOURCE / TARGET
  109. VARIANT
  110. Statistic Functions
  111. QNORM
  112. ZSCORE
  113. CONCAT
  114. LEFT
  115. LEN
  116. LOWER
  117. LTRIM
  118. REVERSE
  119. RIGHT
  120. RTRIM
  121. STR_TO_INT
  122. SUBSTRING
  123. UPPER
  124. Operators
  125. CASE WHEN
  126. FILTER
  127. Math Operators
  128. Addition Operator
  129. Division Operator
  130. MODULO
  131. Multiplication Operator
  132. Subtraction Operator
  133. Predicate Operators
  134. IN
  135. LIKE
  136. Ссылки на мануалы