Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Data Transformation Help Needed

Hi Qlik Community,

I have a spreadsheet that maintains information on what working teams people are assigned to.  Below is an example but the real sheet is many more rows (people) and columns (teams and people attributes). 

Sort LevelNameGEOTeam 1Team 2Team 3Team 4Team 5Number of TeamsParticipating on Team?
1-NatGlenn RiceGEO2111Yes
2-RegTrey BurkeGEO24112Yes
1-NatJalen RoseGEO211Yes
2-RegBarry SandersGEO2411Yes
4-TerrKirk GibsonGEO246A211Yes
4-TerrChris SpeilmanGEO246A4112Yes
3-DivHerman MooreGEO21611Yes
4-TerrCalvin JohnsonGEO216A111Yes
4-TerrTom BradyGEO216B111Yes
2-RegDesmond HowardGEO2111Yes

While I am loading this data as is, which works for the analytics needs in qlik, I would like to also have the data loaded so that I can report from a table that looks like this:

NameTeam
Glenn RiceTeam 1
Jalen RoseTeam 1
Barry SandersTeam 1
Herman MooreTeam 1
Tom BradyTeam 1
Trey BurkeTeam 2
Kirk GibsonTeam 2
Chris SpeilmanTeam 2
Calvin JohnsonTeam 2
Desmond HowardTeam 2
Trey BurkeTeam 4
Chris SpeilmanTeam 4
Glen RiceTeam 5

Can I do this via transformation?  I am limited in what I can do on the original input.

Thanks for any help that you can offer!

Sam

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

Temp:

LOAD [Sort Level],

     Name,

     GEO,

     [Team 1],

     [Team 2],

     [Team 3],

     [Team 4],

     [Team 5],

     [Number of Teams],

     [Participating on Team?]

FROM

[http://community.qlik.com/thread/138134]

(html, codepage is 1252, embedded labels, table is @1);

Temp2:

CrossTable(Team,Data)

Load

  Name,

  [Team 1],

    [Team 2],

    [Team 3],

    [Team 4],

    [Team 5]

Resident Temp;

NoConcatenate

Final:

Load Name,Team Resident Temp2 Where Len(Trim(Data))>0;

Drop Table Temp2;

Drop Table Temp;

View solution in original post

6 Replies
MK_QSL
MVP
MVP

Temp:

LOAD [Sort Level],

     Name,

     GEO,

     [Team 1],

     [Team 2],

     [Team 3],

     [Team 4],

     [Team 5],

     [Number of Teams],

     [Participating on Team?]

FROM

[http://community.qlik.com/thread/138134]

(html, codepage is 1252, embedded labels, table is @1);

Temp2:

CrossTable(Team,Data)

Load

  Name,

  [Team 1],

    [Team 2],

    [Team 3],

    [Team 4],

    [Team 5]

Resident Temp;

NoConcatenate

Final:

Load Name,Team Resident Temp2 Where Len(Trim(Data))>0;

Drop Table Temp2;

Drop Table Temp;

stigchel
Partner - Master
Partner - Master

There are some excellent articles on Hierarchy (created by Henric  Cronstrom) that may help you. See attached document

MarcoWedel

Hi,

one solution without hard coding team names could be:

QlikCommunity_Thread_138134_Pic1.JPG.jpg

tabTeamAssignement:

LOAD *

FROM [http://community.qlik.com/thread/138134] (html, codepage is 1252, embedded labels, table is @1);

tabTeamName:

CrossTable (Team, IsAssigned, 2)

LOAD * Resident tabTeamAssignement;

Right Join (tabTeamName)

LOAD Name, Team

Resident tabTeamName

Where Team like 'Team*' and IsAssigned;

DROP Fields [Sort Level], IsAssigned From tabTeamName;

hope this helps

regards

Marco

Not applicable
Author

Thanks Marco,

Great process but in my example, I replaced teh real team names with Team 1, Team 2 etc.  I might actually put "Team" in front of all my team moving forward though!

Thanks Again!

MarcoWedel

Then make it:


Where not Team like 'Number*' and not Team like 'Participating*' and not Team like 'Geo' and IsAssigned;


Hope this helps

Regards

Marco

MarcoWedel

Or


Where not Wildmatch(Team,'Number*', 'Participating*', 'Geo') and IsAssigned;