本帖最后由 RickyJen 于 2023-5-12 15:49 编辑
问题描述:
使用Wyn仪表板的“透视表”,从数据库得到的数据是英文,想要根据自定义的规则转化为中文(不局限于中文),举个简化的例子:
从数据库得到的数据字段有一列是性别,字段值是“M”或者“F”,想让其在仪表板的透视表中展示为“男”或者“女”,相当于是做一个转换
下方的图片中从数据库中得到的标红框的合同类型是英文,我想通过某种方式将其转化为中文,例如像报表中使用SWITCH函数转化匹配到的数据一样。
问题截图:
尝试过的办法:
1、使用数据格式化,但是只能改变数据的格式和外观
2、使用新建计算列,但是绑定到透视表中,查询数据失败,以下是计算列的转化逻辑:
SWITCH(
'分包合同移交分发'[SUB_SINOMAEE_CONTRACT_TYPE]="Construction Contract","施工合同",
'分包合同移交分发'[SUB_SINOMAEE_CONTRACT_TYPE]="Civil Construction Contract","土建施工合同",
'分包合同移交分发'[SUB_SINOMAEE_CONTRACT_TYPE]="Steel Structure Grid Procurement Contract","钢结构/网架采购合同",
'分包合同移交分发'[SUB_SINOMAEE_CONTRACT_TYPE]="Steel Structure Grid Installation Contract","钢结构/网架安装合同",
'分包合同移交分发'[SUB_SINOMAEE_CONTRACT_TYPE]="Steel Structure Grid Procurement And Installation Contract","钢结构/网架采购安装合同",
'分包合同移交分发'[SUB_SINOMAEE_CONTRACT_TYPE]="Installation Contract","安装合同",
'分包合同移交分发'[SUB_SINOMAEE_CONTRACT_TYPE]="Domestic Process Equipment Contract","国产工艺设备合同",
'分包合同移交分发'[SUB_SINOMAEE_CONTRACT_TYPE]="Domestic Electrical Automation Equipment Contract","国产电气自动化设备合同",
'分包合同移交分发'[SUB_SINOMAEE_CONTRACT_TYPE]="Domestic Material Contract","国产材料合同",
'分包合同移交分发'[SUB_SINOMAEE_CONTRACT_TYPE]="Re Export Process Equipment Contract","转口工艺设备合同",
'分包合同移交分发'[SUB_SINOMAEE_CONTRACT_TYPE]="Transit Electrical Automation Equipment","转口电气自动化设备",
'分包合同移交分发'[SUB_SINOMAEE_CONTRACT_TYPE]="Local Procurement Contract","当地采购合同",
'分包合同移交分发'[SUB_SINOMAEE_CONTRACT_TYPE]="Other Procurement Contracts","其他采购合同",
'分包合同移交分发'[SUB_SINOMAEE_CONTRACT_TYPE]="Domestic Design Contract","国内设计合同",
'分包合同移交分发'[SUB_SINOMAEE_CONTRACT_TYPE]="Foreign Design Contract","国外设计合同",
'分包合同移交分发'[SUB_SINOMAEE_CONTRACT_TYPE]="Technical Service Contract","技术服务合同",
'分包合同移交分发'[SUB_SINOMAEE_CONTRACT_TYPE]="Training Contract","培训合同",
'分包合同移交分发'[SUB_SINOMAEE_CONTRACT_TYPE]="Commissioning Contract","调试合同",
'分包合同移交分发'[SUB_SINOMAEE_CONTRACT_TYPE]="Service Contract","服务合同",
'分包合同移交分发'[SUB_SINOMAEE_CONTRACT_TYPE]="Logistics Contract","物流合同",
'分包合同移交分发'[SUB_SINOMAEE_CONTRACT_TYPE]="Insurance Contract","保险合同",
'分包合同移交分发'[SUB_SINOMAEE_CONTRACT_TYPE]="Foreign Management Contract","国外管理合同",
'分包合同移交分发'[SUB_SINOMAEE_CONTRACT_TYPE]
)
|