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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out 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())

Labels (1)
1 Solution

Accepted Solutions
swuehl
Champion III
Champion III

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
Champion III
Champion III

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
Champion III
Champion III

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?