on 12-07-2015 5:06 PM
Hello All,
I am having a requirement where i need record count and added to the end of the file.
My source structure is SuccessFactors xsd and target is file.comma separated file.
Successafctors will send lots of data but i put a condition on each record level based on the req.
Below is my target structure.
Record_Name
name
empid
firstname
lastname
gender
maritalstatus
Record_Address
address
empid
address1
address2
state
city
country
Record_Job
jobname
empid
jobcode
regulartemp
effectivedate
Record_Rehire
rehire
empid
action
event
Like this we have total 14 records like Record_Name, Record_Address, Record_Job, Record_Rehire, Record_Termination, Record_Pay so on.
Every Record level will have a condition and based on condition record will get created.
Right now i am getting output as below which is correct.
Name,69123,2015-09-29,,Bhaskar,O,Yenneti,,M,S,,1956-03-22
Name,74040,2015-10-26,,Bhaskar,,Yenneti,,M,M,1998-07-25,1958-03-17
Name,89123,2015-10-20,,Bhaskar,J,Yenneti,,F,D,2004-05-03,1963-11-13
Name,67893,11/30/2015,,bhaskar,yennetiJR,F,D,01/30/2012,09/28/2015
Address,69123,11/19/2015,"1734 tropical. E","",sandeigo,34343,,CA,USA
Address,29183,12/05/2015,"6600 tropical","",Oak Red,77712,,TX,USA
Job,71338,2015-10-19,1231,,Y,40.0,S,N,,US
Job,4809,2015-10-19,1234,,Y,40.0,S,N,,,,
Job,12312,2015-10-19,MGU603,,Y,40.0,S,N,,,,
Job,121212,2015-10-20,PSU505,,Y,40.0,S,N,,US
Rehire,100112,2015-10-26,REH,RRU701,,Y,40.0,S,,,,,N
Rehire,121211,2015-10-23,REH,I037,,Y,40.0,H,,,,,N
Termination,12343,2015-10-02,VOL
Termination,1234,2015-06-12,OCI
Termination,43234,2015-10-09,VOL
Termination,343434,2015-10-03,JOB
Pay,21212,10/02/2015,,,,,,,,,,,,,
Pay,12213,10/14/2015,,,,,,,,,,,,,
Pay,123128,10/20/2015,,,,,,,,,,,,,
Pay,232323,07/01/2015,,,,,,,,,,,,,
Pay,343434,10/19/2015,,,,,,,,,,,,,
Pay,4545,07/22/2015,Base Salary,,,,,,,,,,,,,
Pay,34656,08/01/2015,,,,,,,,,,,,,
Now i need a file like below with added Footer to it.
Name,69123,2015-09-29,,Bhaskar,O,Yenneti,,M,S,,1956-03-22
Name,74040,2015-10-26,,Bhaskar,,Yenneti,,M,M,1998-07-25,1958-03-17
Name,89123,2015-10-20,,Bhaskar,J,Yenneti,,F,D,2004-05-03,1963-11-13
Name,67893,11/30/2015,,bhaskar,yennetiJR,F,D,01/30/2012,09/28/2015
Address,69123,11/19/2015,"1734 tropical. E","",sandeigo,34343,,CA,USA
Address,29183,12/05/2015,"6600 tropical","",Oak Red,77712,,TX,USA
Job,71338,2015-10-19,1231,,Y,40.0,S,N,,US
Job,4809,2015-10-19,1234,,Y,40.0,S,N,,,,
Job,12312,2015-10-19,MGU603,,Y,40.0,S,N,,,,
Job,121212,2015-10-20,PSU505,,Y,40.0,S,N,,US
Rehire,100112,2015-10-26,REH,RRU701,,Y,40.0,S,,,,,N
Rehire,121211,2015-10-23,REH,I037,,Y,40.0,H,,,,,N
Termination,12343,2015-10-02,VOL
Termination,1234,2015-06-12,OCI
Termination,43234,2015-10-09,VOL
Termination,343434,2015-10-03,JOB
Pay,21212,10/02/2015,,,,,,,,,,,,,
Pay,12213,10/14/2015,,,,,,,,,,,,,
Pay,123128,10/20/2015,,,,,,,,,,,,,
Pay,232323,07/01/2015,,,,,,,,,,,,,
Pay,343434,10/19/2015,,,,,,,,,,,,,
Pay,4545,07/22/2015,Base Salary,,,,,,,,,,,,,
Pay,34656,08/01/2015,,,,,,,,,,,,,
-----End of File-----Rows: 23
How do i achieve this since we have multiple record headers.
Can anyone please help me with the solution.
Thanks,
Bahskar
In target structure you can add another node at the bottow
Counter node
recordcount field
Write a UDF to take all source header as an input as array....In UDF add the size of all arrays and give sum as the output.
In your case input will be Record_Name, Record_Address..........all 14.
Records
Osman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Bhaskar,
why dont use a counter function for the record and then create a FCC with the footer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raghuraman,
Thank you for your response.
There are no main record. Since it is a change file i have declared all 14 record headers.
If i want to use count function i need to use in all 14 records header level after create if condition.
It will give count at each record header level. But i need count for all records header level.
suppose after satisfying condition record_name has 10 records and record_address has 10 then i need in output as 20. If i put count at each record headers level how can i concatenate for both of them.
There is an interface for full file where 1 record will header and multiple fields in it.Here i used count function and declared in FCC which i got output.
Thanks,
Bhaskar
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.