Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
marcelvinicius
Creator III
Creator III

Planejado X Realizado de Excel

Boa tarde Pessoal, como vão?

Tenho as planilhas em anexo, que são as formas de dados que chegam para mim.

Porém estou com dificuldades em montar no Qlik conforme o print abaixo:

REalizado.png

Alguém tem alguma sugestão de como posso fazer? Linkar os dados? Criar Datas?

Muito obrigado

1 Solution

Accepted Solutions
Thiago_Justen_

Marcel,

Conforme falamos creio que este script nos ajudará a finalizar essa questão:

OBJETIVOS_TEMP:

LOAD

     *,   

     Purgechar(COD_DESCRICAO,'0123456789') AS DESCRICAO,  

     KeepChar(COD_DESCRICAO,'0123456789') AS CODIGO;

LOAD   

     F3 AS COD_DESCRICAO,   

     F6 AS JAN_OBJ,   

     F7 AS FEV_OBJ,   

     F8 AS MAR_OBJ

FROM [lib://Download/OBJ.xlsx](ooxml, embedded labels, header is 4 lines, table is OBJ);


OBJETIVOS:

NoConcatenate

LOAD

     *

Resident OBJETIVOS_TEMP WHERE DESCRICAO='Objetivo';

DROP TABLE OBJETIVOS_TEMP;

DROP FIELD COD_DESCRICAO;


REALIZADO:

LOAD   

     F1 AS CODIGO,

     CONTAS,   

     JAN AS JAN_REAL,        

     FEV AS FEV_REAL,  

     MAR AS MAR_REAL

FROM [lib://Download/NOVOS.xlsx](ooxml, embedded labels, table is NOVOS);


Não esqueça de substituir o caminho fonte das planilhas que você me enviou.

Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago

View solution in original post

17 Replies
Thiago_Justen_

Marcel, estou fora do escritório agora, mas assim que estiver com acesso ao Qlik já tento algo pra você (caso alguém não tenha ainda resolvido).

Abs

Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago
marcelvinicius
Creator III
Creator III
Author

Valeu Thiago,

Abraços

marcelvinicius
Creator III
Creator III
Author

Boa tarde pessoal, alguém ?

thiago.justen‌?

Thiago_Justen_

Marcel, tô terminando um projeto importante aqui na empresa. Amanhã vou me dedicar ao teu questionamento.

Desculpa não conseguir resolver mais rápido, de fato vi que ia me tomar alguns minutos a mais do que eu disponho hoje, mas vou te ajudar nessa.

#TMJ

Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago
marcelvinicius
Creator III
Creator III
Author

Fica tranquilo,

Te entendo.

Assim que conseguir me avise.

Abraços

marcelvinicius
Creator III
Creator III
Author

Thiago, recebi agora uma outra forma da planilha como vem.

Se conseguir me add no skype te auxilio: marcel.vinicius.oliveira - curitiba

Att

Thiago_Justen_

Added!

Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago
marcelvinicius
Creator III
Creator III
Author

Bom dia thiago.justen‌, blz?

Conseguiu dar uma olhada?

Alguém pessoal?

Atenciosamente.

paulovendruscol
Creator
Creator

O ideal é sempre viabilizar uma melhor estrutura da sua fonte, mas para resolver o seu caso você precisa criar uma conexão ODBC e fazer um for para realizar a leitura das sheets, veja o exemplo abaixo:

FOR Each Arquivo in FileList('seu diretório\DEF Empresa A.xlsx');

ODBC CONNECT TO [Excel Files;DBQ=$(Arquivo)];

TabelaTemp:

SQLtables;

DISCONNECT;

FOR i = 0 to NoOfRows('TabelaTemp')-1

LET NomeAba = PurgeChar(PurgeChar(Peek('TABLE_NAME', i, 'TabelaTemp'), Chr(39)), Chr(36));

Tabela:

LOAD '$(NomeAba)' as Mes,*

From $(Arquivo)(ooxml, embedded labels, table is [$(NomeAba)]);

NEXT i

DROP Table TabelaTemp;

NEXT Arquivo

TabelaFinal:

CrossTable(Departamento, Valor,2)

LOAD [CONTA CONTABIL] as ContaContabil,

     Mes,

     [DEPTO A],

     [DEPTO B],

     [DEPTO C],

     [DEPTO D],

     [DEPTO E],

     [DEPTO F]

Resident Tabela;

DROP Table Tabela;