Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How can I make this expression formula for field [Kross] selected in listbox by user?

Hello

Help me, please...

How can I make this expression formula for field [Kross] selected in listbox by user? Not for constant: 'ABC', 'DEF', 'QAZ' only.

Because I don't know which [Kross]-values my user will want to choose.

=COUNT({$<[Kross]={'ABC', 'DEF', 'QAZ'}, [Amount]={'>=$(=vProduct_begin)<=$(=vProduct_end)'}>} TOTAL<HID_PARTY>  DISTINCT [Kross])

1 Solution

Accepted Solutions
maxgro
MVP
MVP

this is the concat of selected values (try in a textbox)

= chr(39)

& concat(GetFieldSelections(Kross, chr(39) & ',' & chr(39)))

& chr(39)

so using that in your expression

COUNT ({$ <Kross={$(=chr(39) & concat(GetFieldSelections(Kross, chr(39) & ',' & chr(39))) & chr(39))},

[Amount]={'>=$(=vProduct_begin)<=$(=vProduct_end)'}

>}  TOTAL<HID_PARTY>  DISTINCT [Kross])


View solution in original post

4 Replies
swuehl
MVP
MVP

If you need your expression to be selection sensitive for that field, maybe just remove the set modifier for field [Kross] (since your are already using the default state set identifier)?

=COUNT({$< [Amount]={'>=$(=vProduct_begin)<=$(=vProduct_end)'}>} TOTAL<HID_PARTY>  DISTINCT [Kross])


If this is not what you want, could you post a small sample application and your requested result for some specific selections?

Not applicable
Author

no, I can't remove it

selected [Kross] don't made right selection without additional $<[Kross]={'ABC', 'DEF', 'QAZ'} in SA. Because [Kross] it's used for "AndMode"-field. And it's made right result for person, and it's made wrong result for person's agreements. That's why I need to add additional conditions in expressions for my chart.

And it's really too hard for me to make small sample application.

Can you teach me how to put the selected by user values ​​in SA formula? I tryed to use triggers and put listbox's values in variables, and then use this variables in my SA formula but I don't like it ;(

maxgro
MVP
MVP

this is the concat of selected values (try in a textbox)

= chr(39)

& concat(GetFieldSelections(Kross, chr(39) & ',' & chr(39)))

& chr(39)

so using that in your expression

COUNT ({$ <Kross={$(=chr(39) & concat(GetFieldSelections(Kross, chr(39) & ',' & chr(39))) & chr(39))},

[Amount]={'>=$(=vProduct_begin)<=$(=vProduct_end)'}

>}  TOTAL<HID_PARTY>  DISTINCT [Kross])


Not applicable
Author

thanks!