Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QLIKWORLD LIVE! MAY 16 - 19TH, EARLY BIRD DISCOUNTS! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
f1234567
Contributor III
Contributor III

Put multiple field selections into a variable

Hi experts!
Hope you have the answer for my question for QlikView a Chart.

Background: I Need a chart with three graphs, each combining a group of customers. The grouping should be dynamic.

My solution was to create three variables, vGroupSel1, vGroupSel2 and vGroupSel3. 

In order to set the variables I use three buttons. I select multiple names of a field called GroupSel.
Then I press button1 which puts the selected names into the variable  vGroupSel1, etc.

Currently I do that with following Button-Action :

=chr(39)&GetFieldSelections(GroupSel,chr(39)&','&chr(39))&chr(39)    
// CHR(39) fügt ein Aposthroph ein // CHR(39) = '

Action.GIF

This works perfect as long as I have less then 6 customers selected. The variable then shows following content:

vGroupSel1 = 'Customer A', 'Customer B', 'Customer C'

The chart is working fine, too.

But as soon as I select more than 6 field names, what happens is, the variable content changes to:

vGroupSel1 = '7 of 20'

...with the concequence that the chart is no longer working. Of course, the field Name "7 of 20" is no valid field name.

 

variablename.GIF

Does anybody know how to change the behavior of QV to rather show all names selected instead of '7 of 20' or '9 of 20'  etc?

Or is there any other smart way of creating flexible Graphs as described above?

Thanks in advance!!

Labels (2)
1 Solution

Accepted Solutions
Alexis_Tan
Contributor
Contributor

Hello,

Instead of using this 

=chr(39)&GetFieldSelections(GroupSel,chr(39)&','&chr(39))&chr(39)

Try this in your buttons

=Concat(DISTINCT chr(39)&GroupSel&chr(39), ', ')

Best Regards,

Alex

 

View solution in original post

2 Replies
Alexis_Tan
Contributor
Contributor

Hello,

Instead of using this 

=chr(39)&GetFieldSelections(GroupSel,chr(39)&','&chr(39))&chr(39)

Try this in your buttons

=Concat(DISTINCT chr(39)&GroupSel&chr(39), ', ')

Best Regards,

Alex

 

f1234567
Contributor III
Contributor III
Author

Thanks, Alex!! That's it. Would you mind to shortly explain why this works ?

Thanks a lot,

Frank