Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

DIFFERENT RECORD IN A RECORD AND DIFFERENT COLUMNS

Hi,

I have this table:

I want the second with distinct "cliente" for giro in the columns...

thank's

3 Replies
sunny_talwar

Try this:

Table:

LOAD * INLINE [

    Giro, Cliente

    A, 1

    A, 2

    A, 2

    A, 3

    A, 3

    B, 4

    B, 5

    B, 6

    C, 7

    C, 7

    C, 8

];

Table1:

LOAD Giro,

  SubField(XYZ, ',', 1) as Cli_1,

  SubField(XYZ, ',', 2) as Cli_2,

  SubField(XYZ, ',', 3) as Cli_3;

LOAD Giro,

  Concat(DISTINCT Cliente, ',') as XYZ

Resident Table

Group By Giro;

DROP Table Table;


Output in a table box object:


Output.PNG

HTH

Best,

Sunny

maxgro
MVP
MVP

1.png


T1:

LOAD distinct * INLINE [

    Giro, Cliente

    A, 1

    A, 2

    A, 2

    A, 3

    A, 3

    B, 4

    B, 5

    B, 6

    C, 7

    C, 7

    C, 8

];

T2:

load Giro, Cliente, NewField, 'Cliente_' &  NewField as NewField2;

load if(Peek(Giro)<>Giro, 1, Peek(NewField)+1) as NewField,

  Giro,  Cliente

Resident T1

order by Giro, Cliente;

DROP Field NewField;

DROP Table T1;

Anonymous
Not applicable
Author

Thank you,

it is a good solution but I have the problem that I don't know the number of different "Cliente" for each "Giro".....