Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
nareshthavidishetty
Contributor III

List box Filter hierarchy

Hi i need have a list as below

task1.jpg

Here in need to create an list box as

tsk1.png

With in this if i click on bedding it shows an hierarchy for selection items below

tsk2.png

9 Replies
Not applicable

Re: List box Filter hierarchy

Please elaborate further as to what you require. What does your data look like, what do you want the end result to look like

Thanks,

Byron

Re: List box Filter hierarchy

May be try this in your List Box Properties..

General Tab-> Show as Treeview

                 -> With Separator as Comma

if you want the Grouped field, you can try this in your script Subfield(Type,',',1) as Grouped type

Capture.JPG

MVP & Luminary
MVP & Luminary

Re: List box Filter hierarchy

Hi Naresh,

Select Show as TreeView option in List box Properties with separator as , (Comma).  This will do.

Regards,

Jagan.

nareshthavidishetty
Contributor III

Re: List box Filter hierarchy

Hi after apply the tree view it shows as below,

Untitled.png

But user not comfortable with this.Please check once in initial post

varshavig12
Valued Contributor

Re: List box Filter hierarchy

ARE YOU LOOKING FOR THIS:

MVP & Luminary
MVP & Luminary

Re: List box Filter hierarchy

Do you look for something like this:

subfield(cross_class, ',', 1) as MainGroup

subfield(cross_class, ',', 2) as SubGroup

this will be possible within the script or as listbox-expression.

- Marcus

varshavig12
Valued Contributor

Re: List box Filter hierarchy

If the above pic is as per your requirements

then you can use this or modify as needed.

abc:

HIERARCHY(GEOG_KEY, PARENT_KEY, GEOG_DESC, [GEOG PARENT NAME], GEOG_DESC, [HIERARCHY

GEOG], '|', 'HIERARCHY DEPTH')

LOAD * INLINE [

    GEOG_KEY, PARENT_KEY, GEOG_DESC

    TotalF, , SAMPLE

    Z1, TotalF, BEDDING

    Z2, TotalF, FURNITURE

    Z3, TotalF, HOME_OFFICE

    Z4, TotalF, HOME_ELECTRONICS  

];

RENAME FIELD GEOG_DESC1 to TOTAL;

RENAME FIELD GEOG_DESC2 to ZONE;

def:

HierarchyBelongsTo(GEOG_KEY, PARENT_KEY, GEOG_DESC,'ANCESTORS_KEY',

'ANCESTORS_NAME', 'Depth')

LOAD * INLINE [

    GEOG_KEY, PARENT_KEY, GEOG_DESC

    Z1, TotalF, BEDDING

    Z2, TotalF, FURNITURE

    Z3, TotalF, HOME_OFFICE

    Z4, TotalF, HOME_ELECTRONICS

  

];

REL_def:

LOAD ANCESTORS_KEY as GEOG_KEY

resident def;

   

RENAME FIELD GEOG_DESC1 to TOTAL1;

RENAME FIELD GEOG_DESC2 to ZONE1;

Not applicable

Re: List box Filter hierarchy

Hi Naresh,

See the below script and you will get the desired result.

LOAD if(Index(@1,',')=0, @1&'!', SubField(@1,',',1)&'!'&@1) as output

FROM

(txt, codepage is 1252, no labels, delimiter is '!', msq);

Here @1 is column name

And in the list box, Show as Tree View in that Add Seperator to '!' like below and you will get the desired result.

Thanks,

Sreeman

Not applicable

Re: List box Filter hierarchy

Hi Naresh,


Have you tried the above scenario? Please let me know

Thanks,

Sreeman