简体   繁体   English

解释如何在 Informatica Powercenter 中工作 MOD Function 以及此条件如何在表达式转换中工作 IIF((Nextval % 5) = 0, 1, 0)

[英]Explain How to Work MOD Function in Informatica Powercenter & How this Condition Work in Expression Transformation IIF((Nextval % 5) = 0, 1, 0)

  1. I want to Load Alternate Record in Table &我想在表中加载备用记录 &

  2. Also Load Every Fifth Record Load in the Table.还要在表中加载每第五个记录加载。 This are two Different Scenario I Got Query how to Implement I Just Don't Understand How it is Working.这是两个不同的场景,我查询如何实施我只是不明白它是如何工作的。

  3. What is MOD Function & How MOD Function is Working in Informatica Powercenter.什么是MOD Function以及MOD Function 如何在 Informatica Powercenter 中工作。

  4. How this Condition Work in Expression Transformation IIF((Nextval % 5) = 0, 1, 0)此条件在表达式转换中的工作原理IIF((Nextval % 5) = 0, 1, 0)

For Ex: - My Source Table Contain 107 Records .例如:-我的源表包含107 条记录 So Using this Condition IIF((Nextval % 5) = 0, 1, 0) How it will Load Every Fifth Record in the Target Table?那么使用这个条件IIF((Nextval % 5) = 0, 1, 0)它将如何加载目标表中的每五个记录

You are on right track.你走在正确的轨道上。

sequence generator will generate sequential values for Nextval field in expression.序列生成器将为表达式中的Nextval字段生成序列值。
And IIF((Nextval % 5) = 0, 1, 0) will pick every 5th record. IIF((Nextval % 5) = 0, 1, 0) 将每 5 条记录选取一次。
MOD() - like any arithmetic function, will return reminder of a division operation. MOD() - 与任何算术 function 一样,将返回除法运算的提醒。 for example, MOD(5,2) = 1 same can be done in informatica 5%2 = 1.例如, MOD(5,2) = 1同样可以在 informatica 5%2 = 1 中完成。

So, your mapping should be like -所以,你的映射应该是这样的 -

  1. sort the data the way you want.按您想要的方式对数据进行排序。
  2. add all columns to an expression.将所有列添加到表达式。 Add a sequence generator nextval column to the exp as well.还将序列生成器 nextval 列添加到 exp。
  3. Add a filter with below condition if you want to pick alternate row.如果要选择备用行,请添加具有以下条件的过滤器。
IIF((Nextval % 2) = 0, False, True) -- picks odd rows.

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

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