@@ -164,7 +164,7 @@ SELECT cast(uuid() as varchar) as uuid,
164
164
ELSE unitofmeasure
165
165
END) as unit_of_measure,
166
166
sum (coalesce(nullif(azure .quantity , 0 ), azure .usagequantity )) as usage_quantity,
167
- coalesce(nullif(azure .billingcurrencycode , ' ' ), azure .currency ) as currency,
167
+ coalesce(nullif(azure .billingcurrencycode , ' ' ), nullif( azure .currency , ' ' ), azure . billingcurrency ) as currency,
168
168
sum (coalesce(nullif(azure .costinbillingcurrency , 0 ), azure .pretaxcost )) as pretax_cost,
169
169
azure .tags ,
170
170
max (azure .resource_id_matched ) as resource_id_matched,
@@ -183,7 +183,7 @@ GROUP BY coalesce(azure.date, azure.usagedatetime),
183
183
coalesce(nullif(servicename, ' ' ), metercategory),
184
184
coalesce(nullif(subscriptionid, ' ' ), subscriptionguid),
185
185
azure .resourcelocation ,
186
- coalesce(nullif(azure .billingcurrencycode , ' ' ), azure .currency ),
186
+ coalesce(nullif(azure .billingcurrencycode , ' ' ), nullif( azure .currency , ' ' ), azure . billingcurrency ),
187
187
azure .tags
188
188
;
189
189
@@ -233,7 +233,7 @@ SELECT cast(uuid() as varchar) as uuid,
233
233
ELSE unitofmeasure
234
234
END) as unit_of_measure,
235
235
sum (coalesce(nullif(azure .quantity , 0 ), azure .usagequantity )) as usage_quantity,
236
- coalesce(nullif(azure .billingcurrencycode , ' ' ), azure .currency ) as currency,
236
+ coalesce(nullif(azure .billingcurrencycode , ' ' ), nullif( azure .currency , ' ' ), azure . billingcurrency ) as currency,
237
237
sum (coalesce(nullif(azure .costinbillingcurrency , 0 ), azure .pretaxcost )) as pretax_cost,
238
238
json_format(
239
239
cast(
@@ -260,7 +260,7 @@ GROUP BY coalesce(azure.date, azure.usagedatetime),
260
260
coalesce(nullif(servicename, ' ' ), metercategory),
261
261
coalesce(nullif(subscriptionid, ' ' ), subscriptionguid),
262
262
azure .resourcelocation ,
263
- coalesce(nullif(azure .billingcurrencycode , ' ' ), azure .currency ),
263
+ coalesce(nullif(azure .billingcurrencycode , ' ' ), nullif( azure .currency , ' ' ), azure . billingcurrency ),
264
264
12 , -- tags
265
265
azure .matched_tag
266
266
;
0 commit comments