Skip to main content
Announcements
Qlik and Talend Support Cases are now opened in the same place.

Tratando tabela Json web sem plugin

cancel
Showing results for 
Search instead for 
Did you mean: 
messiasstelzer
Contributor II
Contributor II

Tratando tabela Json web sem plugin

Last Update:

Sep 21, 2022 1:07:35 PM

Updated By:

Sue_Macaluso

Created date:

Sep 20, 2019 8:33:58 AM

Attachments

Ola!!

 

Estou disponibilizando um trabalho que fiz para ajudar outras pessoas que assim como não conseguiram instalar o plugin do Json para Qlikview. 

I hope I can solve a lot of people's problem who work loading JSON data.

 


//////////////////////////////// versão 1.0 ///////////////////////////////////////
//////////////////////////////// SET - 2019 ///////////////////////////////////////


TRACE *****************************************************************************************************;
TRACE **************************** Leitura do Base de dados ***********************************;
TRACE *****************************************************************************************************;


Dado:
LOAD *
FROM
[https://api.cartolafc.globo.com/partidas]
(txt, utf8, no labels, delimiter is '\t', msq);


1:
LOAD Replace(Replace(Replace(Replace(Replace(SubField(@1,'],"clubes"',1),'""','"N/D"'),',"',';"'),'"}},{','"}}|{'), '{"partidas":[',''),'":','"&') as Partida,
// SubField(@1,'}}],',1) as Partida,
Replace(Replace(Replace(SubField(@1,'],"clubes":{',2),'"},"2','"}&"2'),'"},"3','"}&"3'),':','|') as Clube
// Trim(TextBetween(@1,'"Clube":[',']')) as Clube
// Replace(Replace(Replace(Text,'","','";"'),'":"','"|"'), ':null,','|"N/D";') as CallRecord
Resident Dado;


TRACE *****************************************************************************************************;
TRACE **************************** Tratamento da Base de dados ***********************************;
TRACE *****************************************************************************************************;


Partida_Origem:
LOAD SubField( Partida,'|', IterNo()) as Text_P,
IterNo() as IDp
Resident 1
While iterno() <= RangeMax(SubStringCount(Partida,'|'))+1;

DROP Field Partida From Partida_Origem;


Clube_Origem:
LOAD SubField(Clube,'&', IterNo()) as Text_C,
IterNo() as IDc
Resident 1
While iterno() <= RangeMax(SubStringCount(Clube,'&'))+1;

DROP Field Clube From Clube_Origem;
DROP Table Dado, 1;

 

TRACE *****************************************************************************************************;
TRACE **************************** Tratamento dos campos ***********************************;
TRACE *****************************************************************************************************;

Tags (1)
Labels (1)
Version history
Last update:
‎2022-09-21 01:07 PM
Updated by: