@@ -58,53 +58,53 @@ select
58
58
,' MSC' || ' ,' || ' GERMA' as ship_carriers
59
59
,date_dim .d_year as year
60
60
,sum (case when d_moy = 1
61
- then ws_sales_price* ws_quantity else $z0 end) as jan_sales
61
+ then $upscale( ws_sales_price) * $upscale( ws_quantity) else $upscale($z0) end) as jan_sales
62
62
,sum (case when d_moy = 2
63
- then ws_sales_price* ws_quantity else $z0 end) as feb_sales
63
+ then $upscale( ws_sales_price) * $upscale( ws_quantity) else $upscale($z0) end) as feb_sales
64
64
,sum (case when d_moy = 3
65
- then ws_sales_price* ws_quantity else $z0 end) as mar_sales
65
+ then $upscale( ws_sales_price) * $upscale( ws_quantity) else $upscale($z0) end) as mar_sales
66
66
,sum (case when d_moy = 4
67
- then ws_sales_price* ws_quantity else $z0 end) as apr_sales
67
+ then $upscale( ws_sales_price) * $upscale( ws_quantity) else $upscale($z0) end) as apr_sales
68
68
,sum (case when d_moy = 5
69
- then ws_sales_price* ws_quantity else $z0 end) as may_sales
69
+ then $upscale( ws_sales_price) * $upscale( ws_quantity) else $upscale($z0) end) as may_sales
70
70
,sum (case when d_moy = 6
71
- then ws_sales_price* ws_quantity else $z0 end) as jun_sales
71
+ then $upscale( ws_sales_price) * $upscale( ws_quantity) else $upscale($z0) end) as jun_sales
72
72
,sum (case when d_moy = 7
73
- then ws_sales_price* ws_quantity else $z0 end) as jul_sales
73
+ then $upscale( ws_sales_price) * $upscale( ws_quantity) else $upscale($z0) end) as jul_sales
74
74
,sum (case when d_moy = 8
75
- then ws_sales_price* ws_quantity else $z0 end) as aug_sales
75
+ then $upscale( ws_sales_price) * $upscale( ws_quantity) else $upscale($z0) end) as aug_sales
76
76
,sum (case when d_moy = 9
77
- then ws_sales_price* ws_quantity else $z0 end) as sep_sales
77
+ then $upscale( ws_sales_price) * $upscale( ws_quantity) else $upscale($z0) end) as sep_sales
78
78
,sum (case when d_moy = 10
79
- then ws_sales_price* ws_quantity else $z0 end) as oct_sales
79
+ then $upscale( ws_sales_price) * $upscale( ws_quantity) else $upscale($z0) end) as oct_sales
80
80
,sum (case when d_moy = 11
81
- then ws_sales_price* ws_quantity else $z0 end) as nov_sales
81
+ then $upscale( ws_sales_price) * $upscale( ws_quantity) else $upscale($z0) end) as nov_sales
82
82
,sum (case when d_moy = 12
83
- then ws_sales_price* ws_quantity else $z0 end) as dec_sales
83
+ then $upscale( ws_sales_price) * $upscale( ws_quantity) else $upscale($z0) end) as dec_sales
84
84
,sum (case when d_moy = 1
85
- then ws_net_paid_inc_ship_tax * ws_quantity else $z0 end) as jan_net
85
+ then $upscale( ws_net_paid_inc_ship_tax) * $upscale( ws_quantity) else $upscale($z0) end) as jan_net
86
86
,sum (case when d_moy = 2
87
- then ws_net_paid_inc_ship_tax * ws_quantity else $z0 end) as feb_net
87
+ then $upscale( ws_net_paid_inc_ship_tax) * $upscale( ws_quantity) else $upscale($z0) end) as feb_net
88
88
,sum (case when d_moy = 3
89
- then ws_net_paid_inc_ship_tax * ws_quantity else $z0 end) as mar_net
89
+ then $upscale( ws_net_paid_inc_ship_tax) * $upscale( ws_quantity) else $upscale($z0) end) as mar_net
90
90
,sum (case when d_moy = 4
91
- then ws_net_paid_inc_ship_tax * ws_quantity else $z0 end) as apr_net
91
+ then $upscale( ws_net_paid_inc_ship_tax) * $upscale( ws_quantity) else $upscale($z0) end) as apr_net
92
92
,sum (case when d_moy = 5
93
- then ws_net_paid_inc_ship_tax * ws_quantity else $z0 end) as may_net
93
+ then $upscale( ws_net_paid_inc_ship_tax) * $upscale( ws_quantity) else $upscale($z0) end) as may_net
94
94
,sum (case when d_moy = 6
95
- then ws_net_paid_inc_ship_tax * ws_quantity else $z0 end) as jun_net
95
+ then $upscale( ws_net_paid_inc_ship_tax) * $upscale( ws_quantity) else $upscale($z0) end) as jun_net
96
96
,sum (case when d_moy = 7
97
- then ws_net_paid_inc_ship_tax * ws_quantity else $z0 end) as jul_net
97
+ then $upscale( ws_net_paid_inc_ship_tax) * $upscale( ws_quantity) else $upscale($z0) end) as jul_net
98
98
,sum (case when d_moy = 8
99
- then ws_net_paid_inc_ship_tax * ws_quantity else $z0 end) as aug_net
99
+ then $upscale( ws_net_paid_inc_ship_tax) * $upscale( ws_quantity) else $upscale($z0) end) as aug_net
100
100
,sum (case when d_moy = 9
101
- then ws_net_paid_inc_ship_tax * ws_quantity else $z0 end) as sep_net
101
+ then $upscale( ws_net_paid_inc_ship_tax) * $upscale( ws_quantity) else $upscale($z0) end) as sep_net
102
102
,sum (case when d_moy = 10
103
- then ws_net_paid_inc_ship_tax * ws_quantity else $z0 end) as oct_net
103
+ then $upscale( ws_net_paid_inc_ship_tax) * $upscale( ws_quantity) else $upscale($z0) end) as oct_net
104
104
,sum (case when d_moy = 11
105
- then ws_net_paid_inc_ship_tax * ws_quantity else $z0 end) as nov_net
105
+ then $upscale( ws_net_paid_inc_ship_tax) * $upscale( ws_quantity) else $upscale($z0) end) as nov_net
106
106
,sum (case when d_moy = 12
107
- then ws_net_paid_inc_ship_tax * ws_quantity else $z0 end) as dec_net
107
+ then $upscale( ws_net_paid_inc_ship_tax) * $upscale( ws_quantity) else $upscale($z0) end) as dec_net
108
108
from
109
109
{{web_sales}} as web_sales
110
110
cross join {{warehouse}} as warehouse
@@ -138,53 +138,53 @@ select
138
138
,' MSC' || ' ,' || ' GERMA' as ship_carriers
139
139
,date_dim .d_year as year
140
140
,sum (case when d_moy = 1
141
- then cs_ext_list_price* cs_quantity else $z0 end) as jan_sales
141
+ then $upscale( cs_ext_list_price) * $upscale( cs_quantity) else $upscale($z0) end) as jan_sales
142
142
,sum (case when d_moy = 2
143
- then cs_ext_list_price* cs_quantity else $z0 end) as feb_sales
143
+ then $upscale( cs_ext_list_price) * $upscale( cs_quantity) else $upscale($z0) end) as feb_sales
144
144
,sum (case when d_moy = 3
145
- then cs_ext_list_price* cs_quantity else $z0 end) as mar_sales
145
+ then $upscale( cs_ext_list_price) * $upscale( cs_quantity) else $upscale($z0) end) as mar_sales
146
146
,sum (case when d_moy = 4
147
- then cs_ext_list_price* cs_quantity else $z0 end) as apr_sales
147
+ then $upscale( cs_ext_list_price) * $upscale( cs_quantity) else $upscale($z0) end) as apr_sales
148
148
,sum (case when d_moy = 5
149
- then cs_ext_list_price* cs_quantity else $z0 end) as may_sales
149
+ then $upscale( cs_ext_list_price) * $upscale( cs_quantity) else $upscale($z0) end) as may_sales
150
150
,sum (case when d_moy = 6
151
- then cs_ext_list_price* cs_quantity else $z0 end) as jun_sales
151
+ then $upscale( cs_ext_list_price) * $upscale( cs_quantity) else $upscale($z0) end) as jun_sales
152
152
,sum (case when d_moy = 7
153
- then cs_ext_list_price* cs_quantity else $z0 end) as jul_sales
153
+ then $upscale( cs_ext_list_price) * $upscale( cs_quantity) else $upscale($z0) end) as jul_sales
154
154
,sum (case when d_moy = 8
155
- then cs_ext_list_price* cs_quantity else $z0 end) as aug_sales
155
+ then $upscale( cs_ext_list_price) * $upscale( cs_quantity) else $upscale($z0) end) as aug_sales
156
156
,sum (case when d_moy = 9
157
- then cs_ext_list_price* cs_quantity else $z0 end) as sep_sales
157
+ then $upscale( cs_ext_list_price) * $upscale( cs_quantity) else $upscale($z0) end) as sep_sales
158
158
,sum (case when d_moy = 10
159
- then cs_ext_list_price* cs_quantity else $z0 end) as oct_sales
159
+ then $upscale( cs_ext_list_price) * $upscale( cs_quantity) else $upscale($z0) end) as oct_sales
160
160
,sum (case when d_moy = 11
161
- then cs_ext_list_price* cs_quantity else $z0 end) as nov_sales
161
+ then $upscale( cs_ext_list_price) * $upscale( cs_quantity) else $upscale($z0) end) as nov_sales
162
162
,sum (case when d_moy = 12
163
- then cs_ext_list_price* cs_quantity else $z0 end) as dec_sales
163
+ then $upscale( cs_ext_list_price) * $upscale( cs_quantity) else $upscale($z0) end) as dec_sales
164
164
,sum (case when d_moy = 1
165
- then cs_net_paid_inc_ship * cs_quantity else $z0 end) as jan_net
165
+ then $upscale( cs_net_paid_inc_ship) * $upscale( cs_quantity) else $upscale($z0) end) as jan_net
166
166
,sum (case when d_moy = 2
167
- then cs_net_paid_inc_ship * cs_quantity else $z0 end) as feb_net
167
+ then $upscale( cs_net_paid_inc_ship) * $upscale( cs_quantity) else $upscale($z0) end) as feb_net
168
168
,sum (case when d_moy = 3
169
- then cs_net_paid_inc_ship * cs_quantity else $z0 end) as mar_net
169
+ then $upscale( cs_net_paid_inc_ship) * $upscale( cs_quantity) else $upscale($z0) end) as mar_net
170
170
,sum (case when d_moy = 4
171
- then cs_net_paid_inc_ship * cs_quantity else $z0 end) as apr_net
171
+ then $upscale( cs_net_paid_inc_ship) * $upscale( cs_quantity) else $upscale($z0) end) as apr_net
172
172
,sum (case when d_moy = 5
173
- then cs_net_paid_inc_ship * cs_quantity else $z0 end) as may_net
173
+ then $upscale( cs_net_paid_inc_ship) * $upscale( cs_quantity) else $upscale($z0) end) as may_net
174
174
,sum (case when d_moy = 6
175
- then cs_net_paid_inc_ship * cs_quantity else $z0 end) as jun_net
175
+ then $upscale( cs_net_paid_inc_ship) * $upscale( cs_quantity) else $upscale($z0) end) as jun_net
176
176
,sum (case when d_moy = 7
177
- then cs_net_paid_inc_ship * cs_quantity else $z0 end) as jul_net
177
+ then $upscale( cs_net_paid_inc_ship) * $upscale( cs_quantity) else $upscale($z0) end) as jul_net
178
178
,sum (case when d_moy = 8
179
- then cs_net_paid_inc_ship * cs_quantity else $z0 end) as aug_net
179
+ then $upscale( cs_net_paid_inc_ship) * $upscale( cs_quantity) else $upscale($z0) end) as aug_net
180
180
,sum (case when d_moy = 9
181
- then cs_net_paid_inc_ship * cs_quantity else $z0 end) as sep_net
181
+ then $upscale( cs_net_paid_inc_ship) * $upscale( cs_quantity) else $upscale($z0) end) as sep_net
182
182
,sum (case when d_moy = 10
183
- then cs_net_paid_inc_ship * cs_quantity else $z0 end) as oct_net
183
+ then $upscale( cs_net_paid_inc_ship) * $upscale( cs_quantity) else $upscale($z0) end) as oct_net
184
184
,sum (case when d_moy = 11
185
- then cs_net_paid_inc_ship * cs_quantity else $z0 end) as nov_net
185
+ then $upscale( cs_net_paid_inc_ship) * $upscale( cs_quantity) else $upscale($z0) end) as nov_net
186
186
,sum (case when d_moy = 12
187
- then cs_net_paid_inc_ship * cs_quantity else $z0 end) as dec_net
187
+ then $upscale( cs_net_paid_inc_ship) * $upscale( cs_quantity) else $upscale($z0) end) as dec_net
188
188
from
189
189
{{catalog_sales}} as catalog_sales
190
190
cross join {{warehouse}} as warehouse
0 commit comments