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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Limiting contents of a list box

I have a list box with a Field Name entitle 'ANATOMICAL MAIN GROUP'  Under this field, there are the following records:

  1. ALIMENTARY TRACT AND METABOLISM
  2. BLOOD AND BLOOD FORMING ORGANS
  3. CARDIOVASCULAR SYSTEM
  4. DERMATOLOGICALS
  5. GENITOURINARY SYSTEM
  6. HOMORNAL SYSTEM
  7. ANTI-INFECTIVES
  8. ANTINEOPLASTICS

How can i limit the contents of the list box to say:

  1. CARDIOVASCULAR SYSTEM
  2. ALIMENTARY TRACT AND METABOLISM
  3. ANTI-INFECTIVES

Thank you in advance

1 Solution

Accepted Solutions
ali_hijazi
Partner - Master II
Partner - Master II

check attached qvw file

I can walk on water when it freezes

View solution in original post

19 Replies
ali_hijazi
Partner - Master II
Partner - Master II

you can add an expression instead of choosing the available columns

I would suggest to add first a column in your script next to Anatomical main group this column name it flag and give it the value of 1 next to ones that you want to display then in the expression add the following

if(flag=1, [Anatomical main group])

test.png

I can walk on water when it freezes
Anonymous
Not applicable
Author

Dear Ali

Many thanks, i tried the following script:

[Anatomical Main Group]:
LOAD ATCLevelOneCode,
      ATCLevelOneDescript as [Anatomical Main Group],
      Flag,
      if(Flag = 1, ATCLevelOneDescript)
FROM
[$(vFolderSourceData)tblWHOATCLevelOneCodeDescript.xls]
(biff, embedded labels, table is tblWHOATCLevelOneCodeDescript$);

and it is still loading all other items.  What could i be doing wrong?

ali_hijazi
Partner - Master II
Partner - Master II

NO NO

[Anatomical Main Group]:

LOAD ATCLevelOneCode,

      ATCLevelOneDescript as [Anatomical Main Group],

      Flag

FROM

[$(vFolderSourceData)tblWHOATCLevelOneCodeDescript.xls]

(biff, embedded labels, table is tblWHOATCLevelOneCodeDescript$);


then create a new Listbox and choose the expression as I showed you in the image

there you write if(Flag=1,[Anatomical Main Group])

I can walk on water when it freezes
swarup_malli
Specialist
Specialist

In the expression field of the listbox :

copy paste  the following

if([ANATOMICAL MAIN GROUP]= 'CARDIOVASCULAR SYSTEM'

or

[ANATOMICAL MAIN GROUP]='ALIMENTARY TRACT AND METABOLISM'

or

[ANATOMICAL MAIN GROUP]='ANTI-INFECTIVES',

[ANATOMICAL MAIN GROUP])

ali_hijazi
Partner - Master II
Partner - Master II

but what if they want to add a new value?

the Flag is much simpler as data is coming from excel so you only put 1 next to the group you want to show and reload

I can walk on water when it freezes
Anonymous
Not applicable
Author

Many thanks, i have done that  and put the expression under expression in the properties of the list box and the list box continues to show every thing.

shane_spencer
Specialist
Specialist

I use something like this:

=if( match([ANATOMICAL MAIN GROUP],'CARDIOVASCULAR SYSTEM', 'ALIMENTARY TRACT AND METABOLISM','ANTI-INFECTIVES'), [ANATOMICAL MAIN GROUP])

ali_hijazi
Partner - Master II
Partner - Master II

it seems you gave 1 as flag for all groups, put zeros for the ones that you want to hide and 1 for the ones that you want to show it will work

I can walk on water when it freezes
kristoferahlin
Partner - Contributor III
Partner - Contributor III

If the "row number" (1, 2, 3...) is included in the field you can use

if(left( [Anatomical Main Group], 1) <=3, [Anatomical Main Group])