如何使用informatica中的表达式转换将字符串转换为数字?

发布于 2024-08-08 18:05:49 字数 187 浏览 5 评论 0原文

我有数据类型为字符串的源列(金额),包含类似 $793.00、$5791.00 等数据,...

我需要将相同的数据加载到数据类型为 NUMBER 的目标表列(金额)中,

如何使用“$ 获取相同的数据” ' 通过使用 informatica 中的表达式转换在目标中添加符号?

请任何人帮助我,提前致谢。


I have source column(amount) with datatype string, contains the datas like $793.00, $5791.00,...

I need to load this same data into the target table column(amount) with datatype NUMBER

how can i get this same data with '$' symbol in target by using expression transformation in informatica?

anyone help me please, thanks in advance.


如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

反话 2024-08-15 18:05:49

TO_NUMBER(SUBSTR(AMOUNT,INSTR(AMOUNT,'$')+1,LENGTH(AMOUNT)-1))

或者如果它始终是第一个字符并且您不必担心空格

TO_NUMBER(SUBSTR(AMOUNT,2,长度(数量)-1))

TO_NUMBER(SUBSTR(AMOUNT,INSTR(AMOUNT,'$')+1,LENGTH(AMOUNT)-1))

or if it's always the first character and you don't have to worry about spaces

TO_NUMBER(SUBSTR(AMOUNT,2,LENGTH(AMOUNT)-1))

︶葆Ⅱㄣ 2024-08-15 18:05:49

您可以将源列“金额”放入一个表达式元素中,例如“AMOUNT_INPUT”,然后在该表达式中添加一项新项目,这样“AMOUNT_OUTPUT”在此将表达式设置为“TO_NUMBER(AMOUNT_INPUT) )”

You can take source column "amount" into one expression element, say "AMOUNT_INPUT" and add a new item in that expression such that "AMOUNT_OUTPUT" in this make a expression as "TO_NUMBER(AMOUNT_INPUT)"

遮云壑 2024-08-15 18:05:49

某些版本的 Informatica 不支持 TO_NUMBER()。如果您使用的版本属于这种情况,您将需要根据您的用例使用以下其中一项:

  • TO_INTEGER()
  • TO_FLOAT()
  • < code>TO_DECIMAL()

请参阅参考Informatica 函数 了解使用详细信息。

Some versions of Informatica do not support TO_NUMBER(). If that is the case with the version you are using, you will need to use one of the following, as appropriate for your use case:

  • TO_INTEGER()
  • TO_FLOAT()
  • TO_DECIMAL()

See the reference of Informatica functions for usage details.

夜唯美灬不弃 2024-08-15 18:05:49

您还可以使用以下逻辑来获得所需的结果 -
REPLACESTR(1,金额,'$','')

You can also use below logic to get the desired result -
REPLACESTR(1,AMOUNT,'$','')

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文