Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Group Site in ListBox

Hello,

in a list box same values should be grouped. Can a tree structure be realized with a formula?

AD-K

  AD-K (A)
  AD-K (B)
  AD-K (C)
  AD-K (D)

AD-H

AD-H (S)
AD-H (T)

Regards

Stefan

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

May be this

=If(Len(Trim(Site)) > 0 and Match(Site, 'AD', 'AS') = 0, SubField(Site, ' ', 1) & '/' & Site)

View solution in original post

12 Replies
sunny_talwar
MVP
MVP

Something like this?

Capture.PNG

sunny_talwar
MVP
MVP

Or this

SiteView:

LOAD * INLINE [

    Site

    AD-K (A)

    AD-K (B)

    AD-K (C)

    AD-K (D)

    AD-H (S)

    AD-H (T)

];

SiteTree:

LOAD Site,

SubField(Site, ' ', 1) & '/' & Site as SiteTree

Resident SiteView;


Concatenate(SiteTree)

LOAD Site,

SubField(Site, ' ', 1) as SiteTree

Resident SiteView;

Anonymous
Not applicable
Author

Yes, but it is possible to create this view with a formula in listbox?

sunny_talwar
MVP
MVP

May be using this

=If(Len(Trim(Site)) > 0, SubField(Site, ' ', 1) & '/' & Site)

Anonymous
Not applicable
Author

Great. If i have more values like AS and AD in listbox, and only AD-K and AD-H will show in listbox. How is this formula?

sunny_talwar
MVP
MVP

May be this

SubField(Site, '-', 1)

sunny_talwar
MVP
MVP

What exactly are you wish to see in the list box?

Anonymous
Not applicable
Author

Listbox should be filtered by: AD-K and AD-H

sunny_talwar
MVP
MVP

So you don't want to see AD and AS in site listbox?