为配置数据库中的case语句列创建字段过滤器时出现问题

问题描述

我在使用Metabase中的case语句为列创建字段过滤器时遇到问题。

我的SQL代码-

SELECT fk_sender_id,(SELECT company_name FROM Stardb.st_users AS u WHERE 
    u.client_id=plogs.transaction_log.fk_sender_id) AS Sender_name,fk_reciever_id,(SELECT company_name FROM Stardb.st_users AS u WHERE 
    u.client_id=plogs.transaction_log.abc_ref_no) AS Buyer_name,(SELECT company_name FROM Stardb.st_users AS u WHERE u.client_id=plogs.transaction_log.fk_reciever_id) AS Reciver_name,amount,req_type,abc_ref_no,(CASE
WHEN req_type=1 THEN “Inward Remittance”
WHEN req_type=5 THEN “Creation Margin Paid For Auction”
WHEN req_type=7 THEN “Payment Received from Buyer”
WHEN req_type=8 THEN “Funds Transferred To Wallet”
WHEN req_type=9 THEN “Outward Remittance”
WHEN req_type=10 THEN “EMD Refunded after Auction completion”
WHEN req_type=11 THEN “EMD Refunded (Auction time lapsed)”
WHEN req_type=12 THEN “EMD Paid For Auction”
WHEN req_type=13 THEN “Payment Released to Seller”
WHEN req_type=14 THEN “Balance Amount Refunded to Buyer after Trade Complete”
WHEN req_type=15 THEN “ABC Commission taken from Buyer”
WHEN req_type=16 THEN “ABC Commission taken from Seller”
WHEN req_type=19 THEN “EMD Refunded. Auction Rejected after Completion”
WHEN req_type=20 THEN “EMD Refunded (Buyer & Seller).Trade Completed”
WHEN req_type=21 THEN “Creation Margin Refunded.Auction Rejected”
WHEN req_type=22 THEN “SD paid”
WHEN req_type=23 THEN “Balance paid”
WHEN req_type=24 THEN “Extra payment refund(less quantity or deduction etc)”
WHEN req_type=25 THEN “Money Taken from Defaulters”
WHEN req_type=26 THEN “Money Taken from Defaulters”
WHEN req_type=27 THEN “TCS Payment from buyer”
WHEN req_type=28 THEN “TCS Refund to buyer”
WHEN req_type=29 THEN “Payment made to Assayer”
WHEN req_type=33 THEN “Buyer SD Refund”
WHEN req_type=35 THEN “Payment Setoff (Positive)”
WHEN req_type=36 THEN “Payment Setoff (Negative)”
WHEN req_type=37 THEN “Payment for Lab Request taken by client”
WHEN req_type=38 THEN “Payment sent to Lab”
WHEN req_type=40 THEN “Stock Management Charges”
WHEN req_type=41 THEN “Labour Charges”
WHEN req_type=42 THEN “Assaying Charges”
WHEN req_type=43 THEN “Baggage Charges”
WHEN req_type=44 THEN “Weighment Charges”
WHEN req_type=45 THEN “Sutli Charges”
WHEN req_type=46 THEN “SD paid by Seller”
WHEN req_type=47 THEN “Seller SD refunded”
WHEN req_type=48 THEN “Seller SD Forfeit”
END) AS Req_type_status,fk_order_id,created_date_time,bank_utr
FROM plogs.transaction_log
WHERE fk_order_id !=‘0’ AND plogs.transaction_log.isAbc= 1 AND    
plogs.transaction_log.fk_sender_id!=‘0’ and plogs.transaction_log.pay_status!=0

我想为Req_type_status添加一个字段过滤器,其下拉列表中的值为“ Seller SD Forfeit”(卖方SD没收),“ SD退还”等...而不是数字。

P.S。在原始表中,“ Req_type_status”列本身具有数字。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...