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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Is it possible to get possible values from one field to listbox ?

Hi All,

I'm trying to fill listbox with possible values. Hide excluded (Listbox general tab) option is not nice screen for users. I dont want to see any gray area or other records as gray.In macros there is "getpossiblevalues" function but in expressions only getpossiblecount

Table A:

Year, Volume

2008, 12

2009, 13

2010, 14

I put 2 list box , first one : Year ,second one : Volume and then i choose 2008 , I want to see only 12 in the second list box, Is it possible ?(I dont want to see any gray area or other records as gray)

Thank you

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

Create a list box, select <expression>, and enter this:

if(aggr(count(Volume),Volume),Volume)

There might be a simpler expression, but that one appears to work.

View solution in original post

7 Replies
johnw
Champion III
Champion III

Create a list box, select <expression>, and enter this:

if(aggr(count(Volume),Volume),Volume)

There might be a simpler expression, but that one appears to work.

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

How about using QlikView feature "Hide Excluded" in the second List Box?

Ask me about Qlik Sense Expert Class!
Not applicable
Author

Thanks a lot John, it worked. This seems like exactly what I want to do.

Not applicable
Author

Hi, What if i only want to see available values without any user input? Imagine the YEAR listbox restrict to show only year 2008, 2009. so in this case, by default, volume will only show 12,13. 14 will not appear. I tried to include year in the aggr, and <>'0', but still won't work... any hints? Thanks.
Not applicable
Author

ok, i just found a solution, in the count(), just use a set to filter on YEAR, voila !
Not applicable
Author

Hi John,

I am in need of your assistance to  fix out my issue while writing macros:

As you can see in below code here is an array holding values from excel sheet Employee and a listbox created referring to field "names" which is not existing.

What I am looking for is add list of array elements to listbox created and synchronize with the existing data model

sub irf1

Dim names(100)

Set objExcel = CreateObject("Excel.Application")

'Msgbox("Hi")

Set objWorkbook = objExcel.Workbooks.Open _

    ("C:\Employee.xls")

'    msgbox("Hello")

    rowcount =2

  Do Until objExcel.Cells(rowcount,1).Value = ""   

    names(rowcount-2)=objExcel.Cells(rowcount, 1).Value

    'msgbox(names(rowcount-2))

'   

'   msgbox(objExcel.Cells(rowcount, 1).Value)

   rowcount = rowcount + 1

'

Loop

set LB = ActiveDocument.ActiveSheet.CreateListBox

set BoxProp=LB.GetProperties

BoxProp.Def.Name = "names"

LB.SetProperties BoxProp

end sub

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

I suggest that you create a new post for this question as it is not related to this posting. That way you are more likely to get help with your problem.

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein