Qlik Community

Qlik Brasil

Group community for Brazil users. discussion only in Portuguese.

Highlighted
Not applicable

Linha para Coluna

Galera,

no SQL existe uma função chamada STUFF. Essa função me possibilita transformar linhas em coluna mesclada. Exemplo.

Users per sector sales ->>>>>> sample output

Mediante as informações apresentadas, preciso apresentar o campo USR_NAMES numa pivot de forma linear no Qlik.

Alguém saberia me informar se existe alguma função para executar essa operação?

Desde já obrigado pela ajuda!

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: Linha para Coluna

Opposite can be achieved using this:

Table:

LOAD SEC_NAME,

    USR_NAMES

FROM

Community_158934.xls

(biff, embedded labels, table is Sheet1$);

Table1:

NoConcatenate

LOAD SEC_NAME,

  Concat(USR_NAMES, ', ') as USR_NAMES

Resident Table

Group By SEC_NAME;

DROP Table Table;


Best,

Sunny

5 Replies
MVP
MVP

Re: Linha para Coluna

Try with SubField function in the script:

Table:

LOAD * INLINE [

    SEC_NAME, USR_NAMES

    CLOTHES, "KEITH, STEFAN, EDUARD, BRAD"

    ENTERTAINMENT, "ANDERSON, CHARLES, DANNY LUCAS"

];

Table1:

NoConcatenate

LOAD SEC_NAME,

  SubField(USR_NAMES, ', ', IterNo()) as USR_NAMES

Resident Table

While (IterNo() <= SubStringCount(USR_NAMES, ', ') + 1);

DROP Table Table;


Best,

Sunny

Not applicable

Re: Linha para Coluna

Eu precisaria fazer o inverso.

DE

SEC_NAMEUSR_NAMES
CLOTHESBRAD
CLOTHESEDUARD
CLOTHESKEITH
CLOTHESSTEFAN
ENTERTAINMENTANDERSON
ENTERTAINMENTCHARLES
ENTERTAINMENTDANNY LUCAS

PARA

SEC_NAMEUSR_NAMES
CLOTHESBRAD, EDUARD, KEITH, STEFAN
ENTERTAINMENTANDERSON, CHARLES, DANNY LUCAS
MVP
MVP

Re: Linha para Coluna

Opposite can be achieved using this:

Table:

LOAD SEC_NAME,

    USR_NAMES

FROM

Community_158934.xls

(biff, embedded labels, table is Sheet1$);

Table1:

NoConcatenate

LOAD SEC_NAME,

  Concat(USR_NAMES, ', ') as USR_NAMES

Resident Table

Group By SEC_NAME;

DROP Table Table;


Best,

Sunny

Not applicable

Re: Linha para Coluna

Galera,

consegui resolver com o comando concat(USR_NAMES,';').

Obrigado pela ajuda!

MVP
MVP

Re: Linha para Coluna

I am glad I was able to help.

Best,

Sunny