Adding columns in transformer (Numeric)
Moderators: chulett, rschirm, roy
Adding columns in transformer (Numeric)
Here is another interesting one.
I have 4 columns.
column1,column2,column3,column4.
0:00:00,0:00:00,0:25:13,0:10:12
I want to add these all columns in transformer,or aggregator,
column1,column2,column3,column4,Totaltime
0:00:00,0:00:00,0:25:13,0:10:12,0:35:25
Any lead..
Thanks for your help.
I have 4 columns.
column1,column2,column3,column4.
0:00:00,0:00:00,0:25:13,0:10:12
I want to add these all columns in transformer,or aggregator,
column1,column2,column3,column4,Totaltime
0:00:00,0:00:00,0:25:13,0:10:12,0:35:25
Any lead..
Thanks for your help.
What are your data types for the 5 columns?
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
I order to add those values, you need to convert the strings to a time, then perform the math, then convert the result back to a string.
StringToTime() will do the former, and TimeToString() will do the latter.
StringToTime() will do the former, and TimeToString() will do the latter.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Need more info... Are those times of day or elapsed times?
If elapsed times, then the first column (hours) may go over 23 hours. 4321:59:59 could be a valid elapsed time.
Likewise, if your total is over 23:59:59 then what is your rule on how to output the result?
If elapsed times, then the first column (hours) may go over 23 hours. 4321:59:59 could be a valid elapsed time.
Likewise, if your total is over 23:59:59 then what is your rule on how to output the result?
Choose a job you love, and you will never have to work a day in your life. - Confucius
<cough> Server </cough>
Ahh, in a server job you would do an and the result is an integer number of seconds since midnight. You can add those together and use the to get a string output. This will not go over 24 hours, so if your sum can go over that limit you would need to add a bit more logic.
Ahh, in a server job you would do an
Code: Select all
ICONV(In.column1,'MTS')
Code: Select all
OCONV(svSumOfSeconds,'MTS')
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Ok ArndW. My renewal is in process,so cant see the whole explanation. From the part of it, seems like,
Use, ICONV(IN.Column1.'MTS' code for each column and then add those columns as stage variable and linkup to a total time column.
But when using ICONV(IN. ---- it is asking for concatinate,substring,matches,And or OR rather input column)
meaning, straight ICONV(IN.DSLink.Column1,'MTS') not accepting.
Use, ICONV(IN.Column1.'MTS' code for each column and then add those columns as stage variable and linkup to a total time column.
But when using ICONV(IN. ---- it is asking for concatinate,substring,matches,And or OR rather input column)
meaning, straight ICONV(IN.DSLink.Column1,'MTS') not accepting.
Not sure what you mean by it is "asking for" anything, there's nothing more to the syntax than what Arnd posted. Can you be more specific? Examples from the documentation are here. Is your "Column1" a string?
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Then you should be fine... just make sure your input column name is correctly specified. The example you posted has too many "dots" in it:
Code: Select all
ICONV(IN.DSLink.Column1,'MTS')
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers