@guandata/guanmetric 0.1.17 → 0.1.19

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 (41) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +25 -3
  3. package/bin/platforms.js +44 -0
  4. package/bin/run.js +99 -44
  5. package/package.json +16 -4
  6. package/skills/guanmetric/SKILL.md +53 -8
  7. package/skills/guanmetric/evals/evals.json +117 -0
  8. package/skills/guanmetric/evals/fixtures/atomic-detail-read-model.json +18 -0
  9. package/skills/guanmetric/evals/fixtures/confirmed-template-summary.json +12 -0
  10. package/skills/guanmetric/evals/fixtures/create-result-unknown-state.json +13 -0
  11. package/skills/guanmetric/evals/forward-eval-2026-09-21.json +62 -0
  12. package/skills/guanmetric/references/metric-api-contract-examples.json +690 -0
  13. package/skills/guanmetric/references/metric-api-contract.schema.json +349 -0
  14. package/skills/guanmetric/references/metric-api-contracts.md +436 -0
  15. package/skills/guanmetric/references/metric-atomic-mutation.md +11 -0
  16. package/skills/guanmetric/references/metric-business-dictionary-api-contract-examples.json +53 -0
  17. package/skills/guanmetric/references/metric-business-dictionary-api-contract.schema.json +26 -0
  18. package/skills/guanmetric/references/metric-business-dictionary.md +4 -0
  19. package/skills/guanmetric/references/metric-composite-mutation.md +15 -17
  20. package/skills/guanmetric/references/metric-derived-mutation.md +14 -16
  21. package/skills/guanmetric/references/metric-excel-template.md +14 -4
  22. package/skills/guanmetric/references/metric-flow-generate-example.json +79 -0
  23. package/skills/guanmetric/references/metric-flow-generate.schema.json +93 -0
  24. package/skills/guanmetric/references/metric-flow.md +218 -0
  25. package/skills/guanmetric/references/metric-hierarchy-api-contract-examples.json +171 -0
  26. package/skills/guanmetric/references/metric-hierarchy-api-contract.schema.json +167 -0
  27. package/skills/guanmetric/references/metric-hierarchy-api-contracts.md +193 -0
  28. package/skills/guanmetric/references/metric-mutation.md +13 -9
  29. package/skills/guanmetric/references/metric-public-dimension-api-contract-examples.json +62 -0
  30. package/skills/guanmetric/references/metric-public-dimension-api-contract.schema.json +47 -0
  31. package/skills/guanmetric/references/metric-public-dimension.md +4 -0
  32. package/skills/guanmetric/references/metric-tree-api-contract-examples.json +277 -0
  33. package/skills/guanmetric/references/metric-tree-api-contract.schema.json +263 -0
  34. package/skills/guanmetric/references/metric-tree-api-contracts.md +53 -0
  35. package/skills/guanmetric/references/metric-tree-mutation.md +31 -3
  36. package/skills/guanmetric/references/metric-validation-ownership.md +74 -0
  37. package/binaries/guanmetric-darwin-arm64 +0 -0
  38. package/binaries/guanmetric-darwin-x64 +0 -0
  39. package/binaries/guanmetric-linux-arm64 +0 -0
  40. package/binaries/guanmetric-linux-x64 +0 -0
  41. package/binaries/guanmetric-win32-x64.exe +0 -0
@@ -0,0 +1,690 @@
1
+ {
2
+ "schemaVersion": "1.0",
3
+ "provenance": {
4
+ "verifiedAt": "2026-09-21",
5
+ "environment": "test71",
6
+ "note": "结构来自 test71 只读/测试资源实测,标识、名称和人员信息已脱敏;原子创建样例由当前写 DTO 与已存在详情交叉验证。"
7
+ },
8
+ "mutationSuccessResponse": {
9
+ "result": "ok",
10
+ "response": {
11
+ "id": "metric_example_id"
12
+ }
13
+ },
14
+ "list": {
15
+ "request": {
16
+ "projectId": "project_demo",
17
+ "dirId": "dir_demo",
18
+ "status": "PUBLISHED",
19
+ "nameLike": "销售",
20
+ "subTypes": "ATOMIC,COMPOSITE,DERIVED",
21
+ "orderBy": "UTIME_DESC",
22
+ "offset": 0,
23
+ "limit": 20
24
+ },
25
+ "response": {
26
+ "result": "ok",
27
+ "response": {
28
+ "contents": [
29
+ {
30
+ "id": "metric_atomic_sales",
31
+ "domId": "demo",
32
+ "projectId": "project_demo",
33
+ "status": "PUBLISHED",
34
+ "subType": "ATOMIC",
35
+ "name": "销售额",
36
+ "desc": "订单销售额合计",
37
+ "dirId": "dir_demo",
38
+ "businessOwner": {
39
+ "uId": "user_owner",
40
+ "name": "指标负责人",
41
+ "avatar": "",
42
+ "isDel": false
43
+ },
44
+ "creator": {
45
+ "uId": "user_creator",
46
+ "name": "创建人",
47
+ "avatar": "",
48
+ "isDel": false
49
+ },
50
+ "ctime": "2026-09-21 09:00:00",
51
+ "utime": "2026-09-21 09:10:00",
52
+ "hasDraft": false,
53
+ "canManage": true,
54
+ "canUse": true,
55
+ "statisticsData": {
56
+ "referenceAllCnt": 0,
57
+ "viewCnt": 0
58
+ },
59
+ "timeDim": {
60
+ "fdId": "fd_order_date"
61
+ },
62
+ "bizAttrs": [],
63
+ "favorite": false,
64
+ "approvalStatus": null
65
+ }
66
+ ],
67
+ "count": 1,
68
+ "dirPath": [
69
+ {
70
+ "dirId": "dir_demo",
71
+ "dirName": "销售指标"
72
+ }
73
+ ]
74
+ }
75
+ }
76
+ },
77
+ "atomic": {
78
+ "fieldSource": {
79
+ "createRequest": {
80
+ "projectId": "project_demo",
81
+ "subType": "ATOMIC",
82
+ "dsId": "ds_orders",
83
+ "name": "销售额",
84
+ "engName": "sales_amount",
85
+ "fdId": "fd_amount",
86
+ "aggrType": "SUM",
87
+ "applicableDims": [
88
+ "fd_order_date",
89
+ "fd_region"
90
+ ],
91
+ "timeDim": "fd_order_date",
92
+ "desc": "订单销售额合计",
93
+ "parentDirId": "dir_demo",
94
+ "businessOwner": "user_owner",
95
+ "publish": false
96
+ },
97
+ "updateRequest": {
98
+ "projectId": "project_demo",
99
+ "subType": "ATOMIC",
100
+ "dsId": "ds_orders",
101
+ "name": "销售额(含税)",
102
+ "fdId": "fd_amount",
103
+ "aggrType": "SUM",
104
+ "applicableDims": [
105
+ "fd_order_date",
106
+ "fd_region"
107
+ ],
108
+ "timeDim": "fd_order_date",
109
+ "desc": "订单含税销售额合计",
110
+ "publish": false
111
+ },
112
+ "detailResponse": {
113
+ "result": "ok",
114
+ "response": {
115
+ "id": "metric_atomic_sales",
116
+ "projectId": "project_demo",
117
+ "projectName": "经营指标",
118
+ "parentDirId": "dir_demo",
119
+ "subType": "ATOMIC",
120
+ "uniformResourceType": "METRIC_ATOMIC",
121
+ "status": "PUBLISHED",
122
+ "name": "销售额",
123
+ "desc": "订单销售额合计",
124
+ "dsInfo": {
125
+ "dsId": "ds_orders",
126
+ "name": "订单明细"
127
+ },
128
+ "fdInfos": [
129
+ {
130
+ "dsId": "ds_orders",
131
+ "fdId": "fd_amount",
132
+ "name": "订单金额",
133
+ "fdType": "DOUBLE",
134
+ "metaType": "METRIC",
135
+ "publicDimensions": []
136
+ }
137
+ ],
138
+ "aggrType": "SUM",
139
+ "applicableDims": [
140
+ {
141
+ "dsId": "ds_orders",
142
+ "fdId": "fd_region",
143
+ "name": "区域",
144
+ "fdType": "STRING",
145
+ "metaType": "DIM",
146
+ "publicDimensions": []
147
+ }
148
+ ],
149
+ "timeDim": {
150
+ "fdId": "fd_order_date",
151
+ "name": "订单日期",
152
+ "fdType": "DATE",
153
+ "metaType": "DIM"
154
+ },
155
+ "businessOwner": {
156
+ "uId": "user_owner",
157
+ "name": "指标负责人",
158
+ "isDel": false
159
+ },
160
+ "creator": {
161
+ "uId": "user_creator",
162
+ "name": "创建人",
163
+ "isDel": false
164
+ },
165
+ "canManage": true,
166
+ "canUse": true,
167
+ "hasDraft": false,
168
+ "ctime": "2026-09-21 09:00:00",
169
+ "utime": "2026-09-21 09:10:00"
170
+ }
171
+ }
172
+ },
173
+ "expression": {
174
+ "createRequest": {
175
+ "projectId": "project_demo",
176
+ "subType": "ATOMIC",
177
+ "dsId": "ds_orders",
178
+ "name": "含税销售额",
179
+ "formulaField": {
180
+ "fdFormula": "SUM([fd_amount]) + SUM([fd_tax])"
181
+ },
182
+ "applicableDims": [
183
+ "fd_order_date",
184
+ "fd_region"
185
+ ],
186
+ "timeDim": "fd_order_date",
187
+ "desc": "订单金额与税额之和",
188
+ "parentDirId": "dir_demo",
189
+ "businessOwner": "user_owner",
190
+ "publish": false
191
+ },
192
+ "updateRequest": {
193
+ "projectId": "project_demo",
194
+ "subType": "ATOMIC",
195
+ "dsId": "ds_orders",
196
+ "name": "含税销售额",
197
+ "formulaField": {
198
+ "fdFormula": "SUM([fd_amount]) + SUM([fd_tax]) - SUM([fd_discount])"
199
+ },
200
+ "applicableDims": [
201
+ "fd_order_date",
202
+ "fd_region"
203
+ ],
204
+ "timeDim": "fd_order_date",
205
+ "desc": "订单金额加税额再减优惠",
206
+ "publish": false
207
+ },
208
+ "detailResponse": {
209
+ "result": "ok",
210
+ "response": {
211
+ "id": "metric_atomic_taxed_sales",
212
+ "projectId": "project_demo",
213
+ "parentDirId": "dir_demo",
214
+ "subType": "ATOMIC",
215
+ "uniformResourceType": "METRIC_ATOMIC",
216
+ "status": "UNPUBLISHED",
217
+ "name": "含税销售额",
218
+ "desc": "订单金额与税额之和",
219
+ "dsInfo": {
220
+ "dsId": "ds_orders",
221
+ "name": "订单明细"
222
+ },
223
+ "formulaField": {
224
+ "fdFormula": "SUM([fd_amount]) + SUM([fd_tax])",
225
+ "fdType": "DOUBLE"
226
+ },
227
+ "fdInfos": [
228
+ {
229
+ "dsId": "ds_orders",
230
+ "fdId": "fd_amount",
231
+ "name": "订单金额",
232
+ "fdType": "DOUBLE",
233
+ "metaType": "METRIC"
234
+ },
235
+ {
236
+ "dsId": "ds_orders",
237
+ "fdId": "fd_tax",
238
+ "name": "税额",
239
+ "fdType": "DOUBLE",
240
+ "metaType": "METRIC"
241
+ }
242
+ ],
243
+ "aggrType": null,
244
+ "applicableDims": [
245
+ {
246
+ "dsId": "ds_orders",
247
+ "fdId": "fd_region",
248
+ "name": "区域",
249
+ "fdType": "STRING",
250
+ "metaType": "DIM"
251
+ }
252
+ ],
253
+ "timeDim": {
254
+ "fdId": "fd_order_date",
255
+ "name": "订单日期",
256
+ "fdType": "DATE",
257
+ "metaType": "DIM"
258
+ }
259
+ }
260
+ }
261
+ }
262
+ },
263
+ "composite": {
264
+ "createRequest": {
265
+ "projectId": "project_demo",
266
+ "subType": "COMPOSITE",
267
+ "name": "客单价",
268
+ "formula": "[metric_sales] / [metric_order_count]",
269
+ "useExpressionMetricCommonDims": true,
270
+ "applicableDims": [
271
+ "fd_order_date",
272
+ "fd_region"
273
+ ],
274
+ "timeDim": "fd_order_date",
275
+ "desc": "销售额除以订单数",
276
+ "parentDirId": "dir_demo",
277
+ "businessOwner": "user_owner",
278
+ "publish": false
279
+ },
280
+ "updateRequest": {
281
+ "projectId": "project_demo",
282
+ "subType": "COMPOSITE",
283
+ "name": "客单价",
284
+ "formula": "[metric_sales] / ([metric_order_count] + 1)",
285
+ "useExpressionMetricCommonDims": true,
286
+ "applicableDims": [
287
+ "fd_order_date",
288
+ "fd_region"
289
+ ],
290
+ "timeDim": "fd_order_date",
291
+ "desc": "销售额除以订单数,分母做零值保护",
292
+ "publish": false
293
+ },
294
+ "detailResponse": {
295
+ "result": "ok",
296
+ "response": {
297
+ "id": "metric_avg_order_value",
298
+ "projectId": "project_demo",
299
+ "projectName": "经营指标",
300
+ "parentDirId": "dir_demo",
301
+ "subType": "COMPOSITE",
302
+ "uniformResourceType": "METRIC_COMPOSITE",
303
+ "status": "UNPUBLISHED",
304
+ "name": "客单价",
305
+ "desc": "销售额除以订单数",
306
+ "formula": "[metric_sales] / [metric_order_count]",
307
+ "useExpressionMetricCommonDims": true,
308
+ "referencedMetrics": [
309
+ {
310
+ "id": "metric_sales",
311
+ "name": "销售额",
312
+ "subType": "ATOMIC",
313
+ "status": "PUBLISHED",
314
+ "desc": "订单销售额合计",
315
+ "timeDim": {
316
+ "fdId": "fd_order_date"
317
+ }
318
+ }
319
+ ],
320
+ "applicableDims": [
321
+ {
322
+ "dsId": "ds_orders",
323
+ "fdId": "fd_region",
324
+ "name": "区域",
325
+ "fdType": "STRING",
326
+ "metaType": "DIM"
327
+ }
328
+ ],
329
+ "timeDim": {
330
+ "fdId": "fd_order_date",
331
+ "name": "订单日期",
332
+ "fdType": "DATE",
333
+ "metaType": "DIM"
334
+ }
335
+ }
336
+ }
337
+ },
338
+ "derived": {
339
+ "comparative": {
340
+ "createRequest": {
341
+ "projectId": "project_demo",
342
+ "subType": "DERIVED",
343
+ "name": "销售额月环比增长值",
344
+ "baseMetricId": "metric_sales",
345
+ "deriveSetting": {
346
+ "deriveType": "ORDINARY",
347
+ "advType": "COMPARATIVE",
348
+ "advValue": {
349
+ "advType": "COMPARATIVE",
350
+ "dateFdId": "fd_order_date_month",
351
+ "valueType": "VALUE",
352
+ "offset": 1,
353
+ "offsetType": "MONTH",
354
+ "granularity": "MONTH",
355
+ "window": {
356
+ "offset": 0
357
+ }
358
+ }
359
+ },
360
+ "desc": "销售额与上月的增长值",
361
+ "parentDirId": "dir_demo",
362
+ "businessOwner": "user_owner",
363
+ "publish": false
364
+ },
365
+ "detailResponse": {
366
+ "result": "ok",
367
+ "response": {
368
+ "id": "metric_sales_mom",
369
+ "projectId": "project_demo",
370
+ "parentDirId": "dir_demo",
371
+ "subType": "DERIVED",
372
+ "uniformResourceType": "METRIC_DERIVED",
373
+ "status": "UNPUBLISHED",
374
+ "name": "销售额月环比增长值",
375
+ "baseMetric": {
376
+ "id": "metric_sales",
377
+ "name": "销售额",
378
+ "subType": "ATOMIC",
379
+ "status": "PUBLISHED",
380
+ "desc": "订单销售额合计",
381
+ "timeDim": {
382
+ "fdId": "fd_order_date"
383
+ }
384
+ },
385
+ "deriveSetting": {
386
+ "advType": "COMPARATIVE",
387
+ "advValue": {
388
+ "advType": "COMPARATIVE",
389
+ "dateFdId": "fd_order_date_month",
390
+ "valueType": "VALUE",
391
+ "offset": 1,
392
+ "offsetType": "MONTH",
393
+ "granularity": "MONTH",
394
+ "window": {
395
+ "offset": 0
396
+ }
397
+ },
398
+ "deriveType": "ORDINARY"
399
+ },
400
+ "filter": null
401
+ }
402
+ }
403
+ },
404
+ "recentX": {
405
+ "createRequest": {
406
+ "projectId": "project_demo",
407
+ "subType": "DERIVED",
408
+ "name": "最近7天销售额",
409
+ "baseMetricId": "metric_sales",
410
+ "deriveSetting": {
411
+ "deriveType": "ORDINARY",
412
+ "advType": "RECENT_X",
413
+ "advValue": {
414
+ "advType": "RECENT_X",
415
+ "granularity": "DAY",
416
+ "baselineOffset": [
417
+ 6,
418
+ 0
419
+ ],
420
+ "baseline": "DATE_RANGE_PARAM_RIGHT",
421
+ "aggrType": "SUM",
422
+ "includeCurrentValue": true
423
+ }
424
+ },
425
+ "desc": "筛选结束日前最近7天销售额",
426
+ "parentDirId": "dir_demo",
427
+ "businessOwner": "user_owner",
428
+ "publish": false
429
+ },
430
+ "detailResponse": {
431
+ "result": "ok",
432
+ "response": {
433
+ "id": "metric_sales_recent_7d",
434
+ "subType": "DERIVED",
435
+ "status": "UNPUBLISHED",
436
+ "baseMetric": {
437
+ "id": "metric_sales",
438
+ "name": "销售额",
439
+ "subType": "ATOMIC",
440
+ "status": "PUBLISHED"
441
+ },
442
+ "deriveSetting": {
443
+ "advType": "RECENT_X",
444
+ "advValue": {
445
+ "advType": "RECENT_X",
446
+ "granularity": "DAY",
447
+ "baselineOffset": [
448
+ 6,
449
+ 0
450
+ ],
451
+ "baseline": "DATE_RANGE_PARAM_RIGHT",
452
+ "aggrType": "SUM",
453
+ "includeCurrentValue": true
454
+ },
455
+ "deriveType": "ORDINARY"
456
+ }
457
+ }
458
+ }
459
+ },
460
+ "xtd": {
461
+ "createRequest": {
462
+ "projectId": "project_demo",
463
+ "subType": "DERIVED",
464
+ "name": "月累计销售额",
465
+ "baseMetricId": "metric_sales",
466
+ "deriveSetting": {
467
+ "deriveType": "ORDINARY",
468
+ "advType": "XTD",
469
+ "advValue": {
470
+ "advType": "XTD",
471
+ "granularity": "MONTH",
472
+ "baseline": "DATE_RANGE_PARAM_RIGHT",
473
+ "includeCurrentValue": true
474
+ }
475
+ },
476
+ "desc": "销售额月累计",
477
+ "parentDirId": "dir_demo",
478
+ "businessOwner": "user_owner",
479
+ "publish": false
480
+ },
481
+ "detailResponse": {
482
+ "result": "ok",
483
+ "response": {
484
+ "id": "metric_sales_mtd",
485
+ "subType": "DERIVED",
486
+ "status": "UNPUBLISHED",
487
+ "baseMetric": {
488
+ "id": "metric_sales",
489
+ "name": "销售额",
490
+ "subType": "ATOMIC",
491
+ "status": "PUBLISHED"
492
+ },
493
+ "deriveSetting": {
494
+ "advType": "XTD",
495
+ "advValue": {
496
+ "advType": "XTD",
497
+ "granularity": "MONTH",
498
+ "includeCurrentValue": true,
499
+ "baseline": "DATE_RANGE_PARAM_RIGHT"
500
+ },
501
+ "deriveType": "ORDINARY"
502
+ }
503
+ }
504
+ }
505
+ },
506
+ "last": {
507
+ "createRequest": {
508
+ "projectId": "project_demo",
509
+ "subType": "DERIVED",
510
+ "name": "期末销售额",
511
+ "baseMetricId": "metric_sales",
512
+ "deriveSetting": {
513
+ "deriveType": "ORDINARY",
514
+ "advType": "LAST",
515
+ "advValue": {
516
+ "advType": "LAST",
517
+ "dateFdId": "fd_order_date",
518
+ "calculationMode": "LAST_NON_EMPTY"
519
+ }
520
+ },
521
+ "desc": "区间内末次有值的销售额",
522
+ "parentDirId": "dir_demo",
523
+ "businessOwner": "user_owner",
524
+ "publish": false
525
+ },
526
+ "detailResponse": {
527
+ "result": "ok",
528
+ "response": {
529
+ "id": "metric_sales_last",
530
+ "subType": "DERIVED",
531
+ "status": "UNPUBLISHED",
532
+ "baseMetric": {
533
+ "id": "metric_sales",
534
+ "name": "销售额",
535
+ "subType": "ATOMIC",
536
+ "status": "PUBLISHED"
537
+ },
538
+ "deriveSetting": {
539
+ "advType": "LAST",
540
+ "advValue": {
541
+ "advType": "LAST",
542
+ "dateFdId": "fd_order_date",
543
+ "calculationMode": "LAST_NON_EMPTY"
544
+ },
545
+ "deriveType": "ORDINARY"
546
+ }
547
+ }
548
+ }
549
+ },
550
+ "bizCondition": {
551
+ "createRequest": {
552
+ "projectId": "project_demo",
553
+ "subType": "DERIVED",
554
+ "name": "华东销售额",
555
+ "baseMetricId": "metric_sales",
556
+ "deriveSetting": {
557
+ "deriveType": "ORDINARY",
558
+ "advType": "BIZ_CONDITION",
559
+ "advValue": {
560
+ "advType": "BIZ_CONDITION"
561
+ }
562
+ },
563
+ "filter": {
564
+ "type": "condition",
565
+ "value": {
566
+ "dsId": "ds_orders",
567
+ "fdId": "fd_region",
568
+ "name": "区域",
569
+ "fdType": "STRING",
570
+ "metaType": "DIM",
571
+ "filterType": "IN",
572
+ "filterValue": [
573
+ "华东"
574
+ ]
575
+ }
576
+ },
577
+ "desc": "区域限定为华东的销售额",
578
+ "parentDirId": "dir_demo",
579
+ "businessOwner": "user_owner",
580
+ "publish": false
581
+ },
582
+ "detailResponse": {
583
+ "result": "ok",
584
+ "response": {
585
+ "id": "metric_sales_east",
586
+ "subType": "DERIVED",
587
+ "status": "UNPUBLISHED",
588
+ "baseMetric": {
589
+ "id": "metric_sales",
590
+ "name": "销售额",
591
+ "subType": "ATOMIC",
592
+ "status": "PUBLISHED"
593
+ },
594
+ "deriveSetting": {
595
+ "advType": "BIZ_CONDITION",
596
+ "advValue": {
597
+ "advType": "BIZ_CONDITION"
598
+ },
599
+ "deriveType": "ORDINARY"
600
+ },
601
+ "filter": {
602
+ "type": "condition",
603
+ "not": false,
604
+ "value": {
605
+ "dsId": "ds_orders",
606
+ "fdId": "fd_region",
607
+ "name": "区域",
608
+ "fdType": "STRING",
609
+ "metaType": "DIM",
610
+ "filterType": "IN",
611
+ "filterValue": [
612
+ "华东"
613
+ ]
614
+ }
615
+ }
616
+ }
617
+ }
618
+ },
619
+ "composite": {
620
+ "createRequest": {
621
+ "projectId": "project_demo",
622
+ "subType": "DERIVED",
623
+ "name": "组合衍生销售指数",
624
+ "deriveSetting": {
625
+ "deriveType": "COMPOSITE",
626
+ "formula": "[metric_sales_recent_7d] + [metric_sales_mtd]"
627
+ },
628
+ "desc": "组合两个衍生结果",
629
+ "parentDirId": "dir_demo",
630
+ "businessOwner": "user_owner",
631
+ "publish": false
632
+ },
633
+ "detailResponse": {
634
+ "result": "ok",
635
+ "response": {
636
+ "id": "metric_sales_index",
637
+ "subType": "DERIVED",
638
+ "status": "UNPUBLISHED",
639
+ "baseMetric": {
640
+ "id": "metric_sales_recent_7d",
641
+ "name": "最近7天销售额",
642
+ "subType": "DERIVED",
643
+ "status": "PUBLISHED"
644
+ },
645
+ "deriveSetting": {
646
+ "formula": "[metric_sales_recent_7d] + [metric_sales_mtd]",
647
+ "deriveType": "COMPOSITE"
648
+ },
649
+ "referencedMetrics": [
650
+ {
651
+ "id": "metric_sales_recent_7d",
652
+ "name": "最近7天销售额",
653
+ "subType": "DERIVED",
654
+ "status": "PUBLISHED"
655
+ },
656
+ {
657
+ "id": "metric_sales_mtd",
658
+ "name": "月累计销售额",
659
+ "subType": "DERIVED",
660
+ "status": "PUBLISHED"
661
+ }
662
+ ]
663
+ }
664
+ }
665
+ },
666
+ "updateRequest": {
667
+ "projectId": "project_demo",
668
+ "subType": "DERIVED",
669
+ "name": "销售额月环比增长值",
670
+ "baseMetricId": "metric_sales",
671
+ "deriveSetting": {
672
+ "deriveType": "ORDINARY",
673
+ "advType": "COMPARATIVE",
674
+ "advValue": {
675
+ "advType": "COMPARATIVE",
676
+ "dateFdId": "fd_order_date_month",
677
+ "valueType": "VALUE",
678
+ "offset": 2,
679
+ "offsetType": "MONTH",
680
+ "granularity": "MONTH",
681
+ "window": {
682
+ "offset": 0
683
+ }
684
+ }
685
+ },
686
+ "desc": "销售额与两个月前的增长值",
687
+ "publish": false
688
+ }
689
+ }
690
+ }