繁体   English   中英

如果列包含特定字符串,则结果为 NULL 否则为另一列,如何在 informatica 中应用此表达式转换?

[英]If column contain particular string then result is NULL else another column, how to apply this Expression Transformation in informatica?

我尝试了以下 function 和代码,但我无法返回列值。

列名: CPOP_SCORE_NB,FILLER_COL_00010

DECODE( TRUE
      ,  FILLER_COL_00010=  '?', ' '
      , FILLER_COL_00010 = ' ', CPOP_SCORE_NB
                        , 'NA' )

IIF(FILLER_COL_00010 = '?', ' ' ,CPOP_SCORE_NB)

现在,如果FILLER_COL_00010列值没有,我想返回CPOP_SCORE_NB列值? .

我是informatica的新手,谁能帮我解决这个问题?

如果 FILLER_COL_00010 列值没有“?”,我想返回 CPOP_SCORE_NB 列值。

在 SQL 中,你会写:

(case when FILLER_COL_00010 not like '%?%' then CPOP_SCORE_NB end)

您可以在您的情况下使用 REG_MATCH Function,

 IIF(REG_MATCH(FILLER_COL_00010,'.*?*.')=FALSE,CPOP_SCORE_NB)

我对您的陈述有简单的解决方案 - i want to return the CPOP_SCORE_NB column value if FILLER_COL_00010 column value not having?

IIF(INSTR(FILLER_COL_00010,'?')=0, CPOP_SCORE_NB)

INSTR将返回? 在 FILLER_COL_00010 中。

谢谢大家,我尝试了所有选项。 但以下对我有用:

IIF(FILLER_COL_00010 = '?',NULL,CPOP_SCORE_NB)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM