Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Transforming Flat File with multiple rows for 1 record to Flat File with mutliple columns

Hi everybody,

 

I usually manage to do what I want with Talend Data Integration, but not that time...

I have a flat file extracted from a SAP Portal that gives me the Java roles associated with their "actions", their users, and their groups.

 

The file is quite simple.

It is structured that way :

 

[role]

rid=<ID of the Java role>

rdesc=<description of the role>

action=<portal actions possible when the user has this role, delimited with ;>

user=<users affected to this role, delimited with ;>

group=<group of users affected to this role, delimited with ;>

 

...and you have that structure for each Java role of the SAP Portal...

 

The relationship is :

rid - rdesc : 1-1

rid - action : 1-n

rid - user : 1-n

rid - group : 1-n

 

I would like to transform my file into 2 column files, structured that way :

rid | rdesc | user

 

...and another one with the group :

rid | rdesc | group

 

As an example I give you an input file :

 

[role]
rid=portal_content/mybeautifullrole1
rdesc=My beautifull role 1
action=ACTN.AUTH_DS.un:N$sap.com/com.sap.security.core.ume.service$Manage_My_Profile

group=ZROLE1;ZROLE2

 

[role]
rid=portal_content/mybeautifullrole2
rdesc=My beautifull role 2
user=TOTO;TATA;TITI

group=ZROLE1

 

[role]
rid=portal_content/mybeautifullrole3
rdesc=My beautifull role 3
user=TATA;TITI

 

...and the result should be :

 

File for the users :

portal_content/mybeautifullrole2 | My beautifull role 2 | TOTO

portal_content/mybeautifullrole2 | My beautifull role 2 | TATA

portal_content/mybeautifullrole2 | My beautifull role 2 | TITI

portal_content/mybeautifullrole3 | My beautifull role 3 | TATA

portal_content/mybeautifullrole3 | My beautifull role 3 | TITI

 

File for the groups :

portal_content/mybeautifullrole1 | My beautifull role 1 | ZROLE1

portal_content/mybeautifullrole1 | My beautifull role 1 | ZROLE2

portal_content/mybeautifullrole2 | My beautifull role 2 | ZROLE1

 

I have tried to do it with tFileInputMSDelimited, tFileInputMSPositionnal, tDenormalize, ... without success.

 

Does anyone have an idea to do that sort of work ?

 

Regards.

 

Guillaume

Labels (2)
1 Reply
Anonymous
Not applicable
Author

I finally succeed to do that quite simply.

You have to use the tFileInputMSPositionnal to do that :

 

0683p000009M9y5.png0683p000009M9fb.png

The important functionnality is the parent line to establish the link with the ID !

The Head value is defined in relationship with the position "0-4" :

  • rid= for rid=
  • rdes for rdesc=
  • acti for action=
  • user for user=
  • grou for group=

 

Here are all the schemas :

0683p000009M9tL.png

...and the corresponding model is "4,9999" (4 for "rid=").

 

0683p000009M9x1.png

You have to add a "rid" field that will be filled by the parent line.

...and the corresponding model is "6,9999,9999" (6 for "rdesc=").

 

0683p000009M9yD.png

You have to add a "rid" field that will be filled by the parent line.

...and the corresponding model is "7,9999,9999" (7 for "action=").

 

0683p000009MA7E.png

You have to add a "rid" field that will be filled by the parent line.

...and the corresponding model is "5,9999,9999" (7 for "user=").

 

0683p000009MA2Q.png

You have to add a "rid" field that will be filled by the parent line.

...and the corresponding model is "6,9999,9999" (6 for "group=").

 

I obtain 5 files with the key "rid" and all the relationships I need : rdesc, action, user and group :

0683p000009M9oJ.png

 

I hope I have been clear enough.

 

Regards.

 

Guillaume