|
@@ -119,26 +119,27 @@ def get_channel_overview(channel,pitcher,start,end,page,page_size,order_by,order
|
|
|
|
|
|
sql="""select channel,toString(dt) date,
|
|
|
view_count,click_count,
|
|
|
- round(if(view_count=0,0,click_count/view_count),4) click_rate,
|
|
|
+ toDecimal32(if(view_count=0,0,click_count/view_count),4) click_rate,
|
|
|
follow_user,
|
|
|
- round(if(click_count=0,0,follow_user/click_count),4) follow_rate,
|
|
|
- round(if(follow_user=0,0,cost/follow_user),2) follow_per_cost,
|
|
|
- round(if(click_count=0,0,first_order_count/click_count),4) order_rate,
|
|
|
- round(if(first_order_user=0,0,cost/first_order_user),2) order_per_cost,
|
|
|
- round(cost,2) cost,
|
|
|
+ toDecimal32(if(click_count=0,0,follow_user/click_count),4) follow_rate,
|
|
|
+ toDecimal32(if(follow_user=0,0,cost/follow_user),2) follow_per_cost,
|
|
|
+ toDecimal32(if(click_count=0,0,first_order_count/click_count),4) order_rate,
|
|
|
+ toDecimal32(if(first_order_user=0,0,cost/first_order_user),2) order_per_cost,
|
|
|
+ toDecimal32(cost,2),
|
|
|
first_order_count,first_order_user,
|
|
|
- round(first_order_amount,2) first_order_amount,order_count,order_user,
|
|
|
- round(order_amount,2) order_amount,
|
|
|
- round(order_amount-first_order_amount,2) old_order_amount,
|
|
|
- round(if(first_order_user=0,0,first_order_amount/first_order_user),2) first_amount_per_user,
|
|
|
- round(if(follow_user=0,0,first_order_amount/follow_user),2) amount_per_follow,
|
|
|
- round(if(first_order_user=0,0,cost/first_order_user),2) first_cost_per_user,
|
|
|
- round(if(follow_user=0,0,first_order_user/follow_user),4) new_user_order_rate,
|
|
|
- round(reg_order_amount,2) reg_user_amount,
|
|
|
- round(total_cost,2) total_cost,
|
|
|
- round(total_amount,2) total_amount,
|
|
|
- round(if(cost=0,0,first_order_amount/cost),4) day_roi,
|
|
|
- round(if(cost=0,0,reg_order_amount/cost),4) all_roi,
|
|
|
+ toDecimal32(first_order_amount,2),
|
|
|
+ order_count,order_user,
|
|
|
+ toDecimal32(order_amount,2),
|
|
|
+ toDecimal32(order_amount-first_order_amount,2),
|
|
|
+ toDecimal32(if(first_order_user=0,0,first_order_amount/first_order_user),2) first_amount_per_user,
|
|
|
+ toDecimal32(if(follow_user=0,0,first_order_amount/follow_user),2) amount_per_follow,
|
|
|
+ toDecimal32(if(first_order_user=0,0,cost/first_order_user),2) first_cost_per_user,
|
|
|
+ toDecimal32(if(follow_user=0,0,first_order_user/follow_user),4) new_user_order_rate,
|
|
|
+ toDecimal32(reg_order_amount,2),
|
|
|
+ toDecimal32(total_cost,2),
|
|
|
+ toDecimal32(total_amount,2),
|
|
|
+ toDecimal32(if(cost=0,0,first_order_amount/cost),4) day_roi,
|
|
|
+ toDecimal32(if(cost=0,0,reg_order_amount/cost),4) all_roi,
|
|
|
if(total_cost=0,0,total_first_amount/total_cost) avg_new_order_rate,
|
|
|
if(reg_order_user=0,0,reg_order_user_again/reg_order_user) old_user_once_order_rate from dw_daily_channel where 1=1 """
|
|
|
if channel!='':
|