Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Jônatas
Contributor III
Contributor III

IMPORTAR ABAS DO EXCEL PARA QLIKVIEW

Boa tarde, pessoal! 

Estou com dificuldade de carregados dados de uma planilha Excel com várias abas,  cria apenas uma tabela.
Preciso da ajuda dos colegas, carregar essa planilha excel com várias abas com nomes JANEIRO-22, FEVEREIRO-22...JULHO-22 e a cada mês é acrescentada uma nova aba nessa planilha. Preciso que o QlikView leia todas as abas como tabelas. Gostaria de saber também, se é possível criar filtro com os nomes das abas para poder filtrar os dados por mês/ano, visto que na tabela não temos uma coluna para Data.

Obrigado!!!!

1 Solution

Accepted Solutions
fernando_tonial
Employee
Employee

Olá, é possível fazer conexão via ODBC.

Confirma se vc tem o ODBC denominado [Excel Files].

ODBC CONNECT TO [Excel Files;DBQ=C:\Users\ftoni\Downloads\PLANILHA IMPRESSORAS.xlsx];

PLANILHAS:
SQLTABLES;

IMPRESSORAS:
LOAD * Inline [ID];

FOR P=0 to NoOfRows('PLANILHAS')-1
	LET vL.Planilha = TextBetween(Peek('TABLE_NAME',P, 'PLANILHAS'),CHR(39),'$');
	TRACE $(vL.Planilha);

	Concatenate (IMPRESSORAS)
	LOAD *, '$(vL.Planilha)' as ORIGEM FROM [C:\Users\ftoni\Downloads\PLANILHA IMPRESSORAS.xlsx]
	(ooxml, embedded labels, table is [$(vL.Planilha)]);

NEXT

DROP Tables PLANILHAS;

 

Don't worry, be Qlik.
Tonial

Don't Worry, be Qlik.

View solution in original post

4 Replies
afurtado
Partner Ambassador/MVP
Partner Ambassador/MVP

Jônatas,

Uma forma seria criar um for com o nome e ano do mes. O risco é que se o mes atual não for atualizado, daria erro de leitura.

Outro forma seria fazer uma leitura por odbc para saber os nomes das abas e ler elas.  Segue um link com dealhes

https://community.qlik.com/t5/App-Development/how-to-connect-to-Excel-with-ODBC/td-p/1567109

 

 

furtado@farolbi.com.br
fernando_tonial
Employee
Employee

Olá, é possível fazer conexão via ODBC.

Confirma se vc tem o ODBC denominado [Excel Files].

ODBC CONNECT TO [Excel Files;DBQ=C:\Users\ftoni\Downloads\PLANILHA IMPRESSORAS.xlsx];

PLANILHAS:
SQLTABLES;

IMPRESSORAS:
LOAD * Inline [ID];

FOR P=0 to NoOfRows('PLANILHAS')-1
	LET vL.Planilha = TextBetween(Peek('TABLE_NAME',P, 'PLANILHAS'),CHR(39),'$');
	TRACE $(vL.Planilha);

	Concatenate (IMPRESSORAS)
	LOAD *, '$(vL.Planilha)' as ORIGEM FROM [C:\Users\ftoni\Downloads\PLANILHA IMPRESSORAS.xlsx]
	(ooxml, embedded labels, table is [$(vL.Planilha)]);

NEXT

DROP Tables PLANILHAS;

 

Don't worry, be Qlik.
Tonial

Don't Worry, be Qlik.
Jônatas
Contributor III
Contributor III
Author

Olá, @afurtado  muito obrigado pela dica! Tentei fazer aqui porém apresentou erros. 

Jônatas
Contributor III
Contributor III
Author

@fernando_tonial, muito obrigado pela solução. Funcionou perfeitamente, foi de grande ajuda! Obrigado!