Hi All,
I need to perform sum(col1) group by col2 in oracle and that value i need to fetch as comma delimited like 99,999,999.
my source column col1 is decimal(22,5) and my target column is varchar2(10).
Is there any way to do this in transformer?
Thanks in Advance,
Needed decimal value in 99,999,999 format
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
It is possible by using a combination of stage-variables and loop-variables.
Maybe this can be slightly optimized. Feel free.
Too complicated? See Ray's post!
Code: Select all
svInput(Varchar(10)):AsInteger(Column))
svLen(Smallint):Len(AsInteger(Column))
svLoops(Smallint):Ceil(svLen/3.0) - dividend needs to be in float-format!
Loop While @ITERATION <= svLoops
lvIndex(Smallint): If @ITERATION = 1 Then svInput [1,Mod(svlaenge,3)] Else If @ITERATION = 2 Then lvPart +1 Else lvPart +3
lvOutput: If @ITERATION = 1 and svLoops > @ITERATION Then svInput [1, lvPart]:"," Else If @ITERATION > 1 and svLoops > @ITERATION then lvOutput: svInput [ lvPart,3]:"," Else lvOutput: svInput [ lvPart,3]
Too complicated? See Ray's post!
"It is not the lucky ones are grateful.
There are the grateful those are happy." Francis Bacon
There are the grateful those are happy." Francis Bacon