commit wip
This commit is contained in:
parent
78707ef649
commit
83e8723d7d
2 changed files with 41 additions and 2 deletions
|
|
@ -96,7 +96,38 @@ with
|
|||
then bpb.id_booking
|
||||
else null
|
||||
end
|
||||
) as number_flagged_bookings
|
||||
) as number_flagged_bookings,
|
||||
count(
|
||||
distinct case
|
||||
when
|
||||
upper(b.booking_state)
|
||||
= {{ var("incomplete_information_booking_state") }}
|
||||
then bpb.id_booking
|
||||
else null
|
||||
end
|
||||
) as incomplete_information_bookings,
|
||||
count(
|
||||
distinct case
|
||||
when upper(b.booking_state) = {{ var("no_flags_booking_state") }}
|
||||
then bpb.id_booking
|
||||
else null
|
||||
end
|
||||
) as no_flags_bookings,
|
||||
count(
|
||||
distinct case
|
||||
when
|
||||
upper(b.booking_state) = {{ var("not_approved_booking_state") }}
|
||||
then bpb.id_booking
|
||||
else null
|
||||
end
|
||||
) as not_approved_bookings,
|
||||
count(
|
||||
distinct case
|
||||
when upper(b.booking_state) = {{ var("rejected_booking_state") }}
|
||||
then bpb.id_booking
|
||||
else null
|
||||
end
|
||||
) as rejected_bookings
|
||||
from bundle_services bs
|
||||
left join
|
||||
int_core__booking_to_product_bundle bpb
|
||||
|
|
@ -116,7 +147,11 @@ select
|
|||
b.number_bookings,
|
||||
b.number_approved_bookings,
|
||||
b.number_cancelled_bookings,
|
||||
b.number_flagged_bookings
|
||||
b.number_flagged_bookings,
|
||||
b.incomplete_information_bookings,
|
||||
b.no_flags_bookings,
|
||||
b.not_approved_bookings,
|
||||
b.rejected_bookings
|
||||
from users u
|
||||
left join accommodations a on u.service_display_name = a.service_display_name
|
||||
left join bookings b on u.service_display_name = b.service_display_name
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue