Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Hierarchy and Tree View in Qlikview

Hello! I'm André Felipe, and i am using the Qlikview in a project, but I'm having trouble to create a query in Qlikview with the Hierarchy function, follow my questions:

I have a tree view that is build on a hierarchy and some items are repeating with his own parent, as in the follow image:

print_qlikview_1.png

and she also generating items with the description empty, as in the follow image:

print_qlikview_2.png

follow the code that i used to generate the tree:

-----------------------------------------------------

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';

//sysprogress - spj800++sys

ODBC CONNECT32 TO t.ems5cad (XUserId is beRMVZFPTDcEXXdMSLZGXZRJ, XPassword is BXDLWZBOKDOADYMFLZcSXZZN);

HIERARQUIA:

Hierarchy("cod_cta_ctbl_filho","cod_cta_ctbl_pai","descricao_no")

LOAD

    "cod_cta_ctbl_filho",

    "cod_cta_ctbl_pai",  

    "des_tit_ctbl",

    "cod_cta_ctbl_filho" & ' - ' & "des_tit_ctbl" as "descricao_no";

SQL SELECT

    "estrut_cta_ctbl"."cod_cta_ctbl_filho",

    "estrut_cta_ctbl"."cod_cta_ctbl_pai",   

    "cta_ctbl"."des_tit_ctbl"

FROM EMS5CAD.PUB."estrut_cta_ctbl",

     EMS5CAD.PUB."cta_ctbl"

     WHERE "estrut_cta_ctbl"."cod_plano_cta_ctbl" = "cta_ctbl"."cod_plano_cta_ctbl"

       AND "estrut_cta_ctbl"."cod_cta_ctbl_filho" = "cta_ctbl"."cod_cta_ctbl";

ODBC CONNECT32 TO t.ems5mov (XUserId is RCfPQZFPTDcEXXdMSLZGXZBF, XPassword is bWUEfZBOKDOADYMFLZcSXZFX);

VALORES:

LOAD

    "cod_cta_ctbl" as "cod_cta_ctbl_filho",

    "dat_sdo_ctbl",

    Month(dat_sdo_ctbl) as Mes,

    Year(dat_sdo_ctbl) as Ano,

    "val_sdo_ctbl_cr",

    "val_sdo_ctbl_db",

    "val_sdo_ctbl_fim";

SQL SELECT

    "sdo_ctbl"."cod_plano_cta_ctbl",

    "sdo_ctbl"."cod_cta_ctbl",

    "sdo_ctbl"."cod_ccusto",

    "sdo_ctbl"."cod_empresa",

    "sdo_ctbl"."cod_estab",

    "sdo_ctbl"."cod_plano_ccusto",

    "sdo_ctbl"."cod_unid_negoc",

    "sdo_ctbl"."dat_sdo_ctbl",

    "sdo_ctbl"."val_sdo_ctbl_cr",

    "sdo_ctbl"."val_sdo_ctbl_db",

    "sdo_ctbl"."val_sdo_ctbl_fim"

FROM EMS5MOV.PUB."sdo_ctbl"   

WHERE "sdo_ctbl"."cod_finalid_econ" = 'Corrente'

  AND "sdo_ctbl"."cod_cenar_ctbl"   = 'FISCAL'

  AND "sdo_ctbl"."dat_sdo_ctbl"    >= '01/01/2009';

JUNCAO: 

LOAD

    "cod_cta_ctbl_filho"

Resident VALORES;

inner join

load

    "cod_cta_ctbl_filho"

Resident HIERARQUIA;  

someone can help me?

Any help would be hugely appreciated.

thanks!

André Felipe

0 Replies