Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Galera,
no SQL existe uma função chamada STUFF. Essa função me possibilita transformar linhas em coluna mesclada. Exemplo.
->>>>>>
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!
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
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
Eu precisaria fazer o inverso.
DE
SEC_NAME | USR_NAMES |
CLOTHES | BRAD |
CLOTHES | EDUARD |
CLOTHES | KEITH |
CLOTHES | STEFAN |
ENTERTAINMENT | ANDERSON |
ENTERTAINMENT | CHARLES |
ENTERTAINMENT | DANNY LUCAS |
PARA
SEC_NAME | USR_NAMES |
CLOTHES | BRAD, EDUARD, KEITH, STEFAN |
ENTERTAINMENT | ANDERSON, CHARLES, DANNY LUCAS |
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
Galera,
consegui resolver com o comando concat(USR_NAMES,';').
Obrigado pela ajuda!
I am glad I was able to help.
Best,
Sunny