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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

listbox selection

Hello,

How come this expression not work?

I wanna show those companies who have data in this year in my listbox

=if(sum({<Year={$(vYearToday)},"[DimCustomer].CustomerName">} "[FactQVTimeRegistered].TimeRegistered") > 0, "[DimCustomer].CustomerName", null())

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Try

=aggr(

if(sum({<Year={$(vYearToday)},"[DimCustomer].CustomerName">} "[FactQVTimeRegistered].TimeRegistered") > 0, only({<"[DimCustomer].CustomerName">} "[DimCustomer].CustomerName") )

,

"[DimCustomer].CustomerName")

)

View solution in original post

5 Replies
swuehl
MVP
MVP

Try

=aggr(

if(sum({<Year={$(vYearToday)},"[DimCustomer].CustomerName">} "[FactQVTimeRegistered].TimeRegistered") > 0, "[DimCustomer].CustomerName")

,

"[DimCustomer].CustomerName")

)

edit: removed misplaced equal sign

Not applicable
Author

I also had something similar to this before - The only downside about this aggr. is that when selection a company then i will only see this company (I see companies who are faded out with grey)

Is it possible to do so, i get all companies with data, but when selecting a company the others are greyed out.

Not applicable
Author

Nope- My variable is a int, so it works fine (tested it with other expressions)

swuehl
MVP
MVP

Try

=aggr(

if(sum({<Year={$(vYearToday)},"[DimCustomer].CustomerName">} "[FactQVTimeRegistered].TimeRegistered") > 0, only({<"[DimCustomer].CustomerName">} "[DimCustomer].CustomerName") )

,

"[DimCustomer].CustomerName")

)

Not applicable
Author

Oh your good!

Thank you Can you explain why? and what the difference is?