'How many 1's are there in selected column/row in Informatica?

I am very new to Informatica. Now I would like to Count how many 1's are there in selected row in Informatica, which we could do easily in excel using COUNTIF formula.

For example, column1 - a,b,c,d ; column2 - 1,2,1,4 ; column3 - 1,1,3,5

How to write expression in Informatica to calculate how many 1's are there in each row (a,b,c,d)?



Solution 1:[1]

occurrence of any string can be calculated like this -

length(column1 ) - length(replacechr(column1,'1','')) 

Take the total length of string and then minus length of everything else in the string.
Use an exp transformation and calculate how many 1 exist in column column1 ,column2,column3...

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Koushik Roy