短縮形式と SAQL 形式の steps プロパティ
aggregateflex ステップ種別の query ノードのプロパティおよび JSON 構文は、ステップが短縮形式か SAQL 形式かによって異なります。
短縮形式 aggregateflex ステップ
1"steps": {
2 "all_Amount_1": {
3 "type": "aggregateflex",
4 "query": {
5 "measures": [
6 [
7 "avg",
8 "Amount"
9 ]
10 ],
11 "groups": [
12 "Account_Name"
13 ],
14 "order": [
15 [
16 "avg_Amount",
17 {
18 "ascending": false
19 }
20 ]
21 ]
22 },
23 "visualizationParameters": {
24 "options": {},
25 "type": "chart",
26 "parameters": {
27 "visualizationType": "hbar",
28 "autoFitMode": "keepLabels",
29 "theme": "wave",
30 "title": {
31 "label": "",
32 "fontSize": 14,
33 "subtitleLabel": "",
34 "subtitleFontSize": 11,
35 "align": "center"
36 },
37 "showValues": true,
38 "axisMode": "multi",
39 "binValues": false,
40 "bins": {
41 "breakpoints": {
42 "low": 0,
43 "high": 100
44 },
45 "bands": {
46 "low": {
47 "label": "",
48 "color": "#B22222"
49 },
50 "medium": {
51 "label": "",
52 "color": "#ffa500"
53 },
54 "high": {
55 "label": "",
56 "color": "#008000"
57 }
58 }
59 },
60 "dimensionAxis": {
61 "showAxis": true,
62 "showTitle": true,
63 "title": "",
64 "customSize": "auto",
65 "icons": {
66 "useIcons": false,
67 "iconProps": {
68 "column": "",
69 "fit": "cover",
70 "type": "round"
71 }
72 }
73 },
74 "measureAxis1": {
75 "sqrtScale": false,
76 "showAxis": true,
77 "customDomain": {
78 "showDomain": false
79 },
80 "showTitle": true,
81 "title": ""
82 },
83 "measureAxis2": {
84 "sqrtScale": false,
85 "showAxis": true,
86 "customDomain": {
87 "showDomain": false
88 },
89 "showTitle": true,
90 "title": ""
91 },
92 "legend": {
93 "show": true,
94 "showHeader": true,
95 "inside": false,
96 "descOrder": false,
97 "position": "right-top",
98 "customSize": "auto"
99 },
100 "tooltip": {
101 "customizeTooltip": false,
102 "showDimensions": true,
103 "dimensions": "",
104 "showMeasures": true,
105 "measures": "",
106 "showPercentage": true,
107 "showNullValues": true,
108 "showBinLabel": true
109 },
110 "trellis": {
111 "enable": false,
112 "showGridLines": true,
113 "flipLabels": false,
114 "type": "x",
115 "chartsPerLine": 4,
116 "size": [
117 100,
118 100
119 ]
120 },
121 "applyConditionalFormatting": true,
122 "showActionMenu": true,
123 "columnMap": {
124 "trellis": [],
125 "plots": [
126 "avg_Amount"
127 ],
128 "dimensionAxis": [
129 "Account_Name"
130 ]
131 }
132 }
133 },
134 "datasets": [
135 {
136 "id": "0Fb6g000000HTE1CAO",
137 "name": "DTC_Opportunity_SAMPLE",
138 "label": "DTC Opportunity",
139 "url": "/services/data/v48.0/wave/datasets/0Fb6g000000HTE1CAO"
140 }
141 ],
142 "useGlobal": true,
143 "isGlobal": false,
144 "label": "all_Amount_1",
145 "broadcastFacet": true,
146 "receiveFacetSource": {
147 "mode": "all",
148 "steps": []
149 },
150 "selectMode": "single"
151 },SAQL 形式 aggregateflex ステップ
ステップが SAQL 形式の場合、各グループと基準がそれぞれ groups と measures プロパティでどのように定義されているか、さらに pigql プロパティでどのように定義されているかを確認してください。クエリの他の部分 (filter、limit、order など) は pigql プロパティで 1 回定義するだけで済みます。関連するグラフウィジェットで正しい予測を表示するには、"groups" および "measures" の短縮形式要素を指定します。
以下のサンプルステップでは、pigql プロパティの 'sum_Amount' および 'sum_quantity' 予測が "measures" で [[ "count", "*", "sum_Amount" ], [ "count", "*", "sum_quantity" ]] として参照されている点に注意してください。pigql プロパティの基準予測には、集計、アンダースコア (_)、および基準名 ('sum_Amount') が常に含まれるため、短縮形式で参照できます。
1"steps": {
2 "Product_StageName_2": {
3 "type": "aggregateflex",
4 "visualizationParameters": {
5 "options": {}
6 },
7 "query": {
8 "pigql": "q = load \"Flexy_Sales\";\n
9 q = group q by ('Product', 'StageName');\n
10 q = foreach q generate 'Product' as 'Product',
11 'StageName' as 'StageName',
12 sum('Amount') as 'sum_Amount',
13 sum('quantity') as 'sum_quantity';\n
14 q = filter q by 'sum_Amount' >= 14550720 && 'sum_Amount' <= 58807698;\n
15 q = order q by 'sum_Amount' desc;\nq = limit q 10000;",
16 "measures": [
17 [
18 "count",
19 "*",
20 "sum_Amount"
21 ],
22 [
23 "count",
24 "*",
25 "sum_quantity"
26 ]
27 ],
28 "groups": [
29 "Product",
30 "StageName"
31 ]
32 },
33 "broadcastFacet": true,
34 "receiveFacetSource": {
35 "mode": "all",
36 "steps": []
37 },
38 "useGlobal": true,
39 "isGlobal": false,
40 "datasets": [{
41 "name": "Flexy_Sales",
42 "url": "/services/data/v38.0/wave/datasets/0FbB00000000q5gKAA",
43 "id": "0FbB00000000q5gKAA"
44 }]
45 }
46}