Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Boa Tarde a todos, estou realizando uma carga de dados de um arquivo TXT com 256.000 registros, porém o qlikview está lendo apenas 151.497 registros. Verifiquei se existe algum caracter estranho nos registros anteriores ao 151.497 e após o 151.497 porém não consegui identificar nada de estranho neste arquivo. Alguém já passou por algum problema parecido? Segue script de carga de dados:
SET ThousandSep='.';
SET DecimalSep=',';
SET MoneyThousandSep='.';
SET MoneyDecimalSep=',';
SET MoneyFormat='R$ #.##0,00;-R$ #.##0,00';
SET TimeFormat='hh:mm:ss';
SET DateFormat='DD/MM/YYYY';
SET TimestampFormat='DD/MM/YYYY hh:mm:ss[.fff]';
SET MonthNames='jan;fev;mar;abr;mai;jun;jul;ago;set;out;nov;dez';
SET DayNames='seg;ter;qua;qui;sex;sáb;dom';
LET vDiretorio='D:\QlikView\ETL';
DIRECTORY $(vDiretorio);
PIS_COFINS:
LOAD 'CT' AS PC_CHAVE_EMPRESA,
'1210' AS PC_DT_PERIODO,
LOC as PC_COD_LOCAL,
NR.NOTA as PC_NR_NOTA_FISCAL,
SER as PC_ID_SERIE,
MATRIC as PC_COD_CLIENTE,
CMI as PC_COD_CMI,
ST as PC_COD_CST,
EMISSAO as PC_DT_EMISSAO,
CD.MERC as PC_COD_PRODUTO,
DESCRICAO as PC_NO_PRODUTO,
VALOR as PC_TT_NOTA_FISCAL,
%BASE as PC_PC_TRIBUTA,
VL_BASE as PC_VL_BASE,
ALIQ_PIS as PC_PC_ALIQ_PIS,
VL_PIS as PC_VL_PIS,
ALIQ_COFINS as PC_ALIQ_COFINS,
VL_COFINS as PC_VL_COFINS,
CD_RECEIR as PC_COD_OPERACAO,
CD_TOTAL as PC_TP_OPERACAO,
CD_CTCPR as PC_COD_CTCPR,
CD_CONTA as PC_COD_CONTA,
DEGRSU as PC_DP_GR_SB,
GRU_CONT as PC_COD_GRUPO_CONTABIL,
CD_LOC as PC_COD_LOCAL_TBGRP,
UF as PC_UF,
EXCE as PC_COD_EXCESSAO,
CONTA as PC_COD_CONTA_DEBITO,
CD.REC as PC_COD_RECEITA,
BLOCO as PC_BLOCO,
BC as PC_ID_NATUREZA_BASE_CALCULO,
TIPO_CRE as PC_ID_TIPO_CREDITO,
TPF as PC_TBF,
AJ as PC_COD_AJUSTE,
CFOP as PC_COD_CFOP,
ARE as PC_COD_AREA_NEGOCIO
FROM
[..\TXT\PISCOFINS_CT1210.txt]
(txt, codepage is 1252, embedded labels, delimiter is ';', msq, filters(
Remove(Row, RowCnd(CellValue, 1, StrCnd(null)))
));
Olá Descobri o problema, tratava-se do formato do arquivo. O arquivo estava em formato ANSI, então o converti para UTF8 e mudei a codificação no script de carga e passou a carregar corretamente.
Verifique se o problema não está no delimitador. Se não for padronizado no txt não irá funcionar.
Abraço!
Então Raphael, eu importei o arquivo no excel e br.office, nos dois aplicativos o arquivo abriu corretamente obedecendo os delimitadores, testei até excluir 10 registros antes do registro 151.497 e 10 depois e mesmo assim a carga foi de 151.497 registros. Os registros que foram lidos estão corretos, mas não consigo entender porque a carga interrompe ao ler este número de registros.
Claudimar,
na configuração da carga do arquivo txt, tenta trocar o "msq" por "no quotes":
de:
(txt, codepage is 1252, embedded labels, delimiter is ';', msq, filters(
Remove(Row, RowCnd(CellValue, 1, StrCnd(null)))
));
para:
(txt, codepage is 1252, embedded labels, delimiter is ';', no quotes, filters(
Remove(Row, RowCnd(CellValue, 1, StrCnd(null)))
));
Olá Descobri o problema, tratava-se do formato do arquivo. O arquivo estava em formato ANSI, então o converti para UTF8 e mudei a codificação no script de carga e passou a carregar corretamente.