Webi报表中的十六进制到十进制

2020-09-11 04:33发布

点击此处---> 群内免费提供SAP练习系统(在群公告中)加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)大家好, 能否请您告诉我如何在...

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


大家好,

能否请您告诉我如何在Webi报表中将十六进制转换为十进制。
我只能在Webi报表中将其转换,不能修改数据库或Universe。

1条回答
一只江湖小虾
2020-09-11 04:47

尝试如下操作:

[数字4] = tonumber(if(Substr([v_test]; Length([v_test]); 1)=" a"或Substr([v_test]; Length ([v_test]); 1)=" A")然后是" 10" 否则if(Substr([v_test]; Length([v_test]); 1)=" b"或Substr([v_test]; Length([v_test]); 1)=" B")则为" 11" 否则if(Substr([v_test]; Length([v_test]); 1)=" C"或Substr([v_test]; Length([v_test]); 1)=" C")然后是" 12" 否则if(Substr([v_test]; Length([v_test]); 1)=" D"或Substr([v_test]; Length([v_test]); 1)=" D")则为" 13" 否则if(Substr([v_test]; Length([v_test]); 1)=" E"或Substr([v_test]; Length([v_test]); 1)=" E")然后是" 14" 否则if(Substr([v_test]; Length([v_test]); 1)=" f"或Substr([v_test]; Length([v_test]); 1)=" F")则为" 15" else Substr([v_test]; Length([v_test]); 1))*功率(16; 0)

[数字3] = tonumber(if(Substr([v_test]; Length([v_test ])-1; 1)=" a"或Substr([v_test]; Length([v_test])-1; 1)=" A")然后是" 10" 否则if(Substr([v_test]; Length([v_test])-1; 1)=" b"或Substr([v_test]; Length([v_test])-1; 1)=" B")然后是" 11 " 否则if(Substr([v_test]; Length([v_test])-1; 1)=" C"或Substr([v_test]; Length([v_test])-1; 1)=" C")则为" 12 " 否则if(Substr([v_test]; Length([v_test])-1; 1)=" D"或Substr([v_test]; Length([v_test])-1; 1)=" D")则为" 13 " 否则if(Substr([v_test]; Length([v_test])-1; 1)=" E"或Substr([v_test]; Length([v_test])-1; 1)=" E")则为" 14 " 否则if(Substr([v_test]; Length([v_test])-1; 1)=" f"或Substr([v_test]; Length([v_test])-1; 1)=" F")则为" 15 " else Substr([v_test]; Length([v_test])-1; 1))*幂(16; 1)

[数字2] = tonumber(if(Substr([v_test]; Length( [v_test])-2; 1)=" a"或Substr([v_test]; Length([v_test])-2; 1)=" A")然后是" 10" 否则if(Substr([v_test]; Length([v_test])-2; 1)=" b"或Substr([v_test]; Length([v_test])-2; 1)=" B")然后是" 11 " 否则if(Substr([v_test]; Length([v_test])-2; 1)=" C"或Substr([v_test]; Length([v_test])-2; 1)=" C")则为" 12 " 否则if(Substr([v_test]; Length([v_test])-2; 1)=" D"或Substr([v_test]; Length([v_test])-2; 1)=" D")则为" 13 " 否则if(Substr([v_test]; Length([v_test])-2; 1)=" E"或Substr([v_test]; Length([v_test])-2; 1)=" E")则为" 14 " 否则if(Substr([v_test]; Length([v_test])-2; 1)=" f"或Substr([v_test]; Length([v_test])-2; 1)=" F")则为" 15 " else Substr([v_test]; Length([v_test])-2; 1))*功率(16; 2)

[数字4] = tonumber(if(Substr([v_test]; Length( [v_test])-3; 1)=" a"或Substr([v_test]; Length([v_test])-3; 1)=" A")然后是" 10" 否则if(Substr([v_test]; Length([v_test])-3; 1)=" b"或Substr([v_test]; Length([v_test])-3; 1)=" B")然后是" 11 " 否则if(Substr([v_test]; Length([v_test])-3; 1)=" C"或Substr([v_test]; Length([v_test])-3; 1)=" C")则为" 12 " 否则if(Substr([v_test]; Length([v_test])-3; 1)=" D"或Substr([v_test]; Length([v_test])-3; 1)=" D")则为" 13 " 否则if(Substr([v_test]; Length([v_test])-3; 1)=" E"或Substr([v_test]; Length([v_test])-3; 1)=" E")则为" 14 " 否则if(Substr([v_test]; Length([v_test])-3; 1)=" f"或Substr([v_test]; Length([v_test])-3; 1)=" F")则为" 15 " else Substr([v_test]; Length([v_test])-3; 1))*幂(16; 3)

最终小数对象为:

[小数] = [Digit4] + [Digit3] + [Digit2] + [Digit1]

这只是一个粗略的主意,我敢肯定,我认为许多手动操作和重复操作都可以通过更有效的方式完成。 同样,这是用于四位数的十六进制数字,因此,如果您的数字小于四位数或更长,则必须对其进行一些修改。

一周热门 更多>