Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
clau2003cos
Contributor III
Contributor III

linha para coluna

Boa tarde!

Estou gerando um dado em txt que quando jogo no excel fica nesse formato 

  

DATAPRODUTOQTDE VENDIDA
01/mai110
01/mai215
01/mai320
01/mai425
02/mai130
02/mai235
02/mai340
02/mai445

mas preciso gerar um txt que quando for importado para o excel fique nesse formato

 

DATA01/mai02/mai
PRODUTOQTDE
1 1030
2 1535
3 2040
4 2545

É possível gera o arquivo?

obs: tenho que gerar em txt devido ao volume de dados

Grato

Labels (1)
1 Solution

Accepted Solutions
clau2003cos
Contributor III
Contributor III
Author

Com a mudança do ultimo set (esta sublinhado), funcionou!!!


Grato!


ORIGEM: 

LOAD DATA, 

     PRODUTO, 

     [QTDE VENDIDA] 

FROM 

[https://community.qlik.com/thread/221439

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

 

SET x=; 

For i = 1 to FieldValueCount('DATA') 

  LET DATA = FieldValue('DATA',i); 

  Final: 

$(x) LOAD distinct 

  PRODUTO, 

  [QTDE VENDIDA] AS [$(DATA)] 

  RESIDENT ORIGEM 

  where DATA='$(DATA)'

  SET x='JOIN(Final)';

NEXT 

View solution in original post

4 Replies
Clever_Anjos
Employee
Employee

Vejas se atende:

ORIGEM:

LOAD DATA,

     PRODUTO,

     [QTDE VENDIDA]

FROM

[https://community.qlik.com/thread/221439]

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

SET x=;

For i = 1 to FieldValueCount('DATA')

  LET DATA = FieldValue('DATA',i);

  Final:

$(x) LOAD distinct

  PRODUTO,

  [QTDE VENDIDA] AS [$(DATA)]

  RESIDENT ORIGEM

  where DATA='$(DATA)';

  SET x='LEFT JOIN(Final)';

NEXT

Clever_Anjos
Employee
Employee

Já chegou a uma resposta? Se sim, marque como respondida, por favor

Como obter ajuda? Leia antes de postar

clau2003cos
Contributor III
Contributor III
Author

Com a mudança do ultimo set (esta sublinhado), funcionou!!!


Grato!


ORIGEM: 

LOAD DATA, 

     PRODUTO, 

     [QTDE VENDIDA] 

FROM 

[https://community.qlik.com/thread/221439

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

 

SET x=; 

For i = 1 to FieldValueCount('DATA') 

  LET DATA = FieldValue('DATA',i); 

  Final: 

$(x) LOAD distinct 

  PRODUTO, 

  [QTDE VENDIDA] AS [$(DATA)] 

  RESIDENT ORIGEM 

  where DATA='$(DATA)'

  SET x='JOIN(Final)';

NEXT 

Clever_Anjos
Employee
Employee

Pro favor, marque como "Correta" para fechar o tópico