Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Fields of Group

Hi,

is there a function which lets me create a listbox which shows all fields of a (cyclic) group?
I want to add a list box which holds the same data as the drop down of a 'cyclic group' button (circled arrow).

So rather than using the built-in QV button, users could additionally choose the field in the list box.

Example:
My cyclic group holds the fields Region, Channel, Product.
The list box shall show the entries Region, Channel, Product.

Can't be too difficult ... ???

Any idea?
Thank you,
Thilo

1 Solution

Accepted Solutions
prieper
Master II
Master II

I do not not, how to read all fields of a group, but have done a similar exercise without a group:
1. create Island-table with desired Fieldnames and assign this to a listbox
2. have a variable reading this listbox
3. take this variable as dimension in your table

HTH
Peter

View solution in original post

6 Replies
prieper
Master II
Master II

I do not not, how to read all fields of a group, but have done a similar exercise without a group:
1. create Island-table with desired Fieldnames and assign this to a listbox
2. have a variable reading this listbox
3. take this variable as dimension in your table

HTH
Peter

Not applicable
Author

This is a little convoluted, but I'm afraid it's the only way as far as I know to achieve what you are looking for.

1. Create a table in your load script to load these options into a field.

CycleOptions:
LOAD * INLINE
[CycleOptions
Region
Channel
Product];


2. Create a list box to contain the field CycleOptions

3. Create a macro to cycle through the cyclic group until you find the one that matches the selection of CycleOptions



SET grp1 = ActiveDocument.GetGroup("YourCyclicGroupName")
DO WHILE grp1.GetActiveField.Name <> ActiveDocument.Fields("CyclicOptions").GetSelectedValues.Item(0).Text
Grp1.Cycle 1
LOOP


Finally, you should attach this macro to the OnChange & OnSelect event triggers for the Field CyclicOptions.

Hope this helps a bit.

markmccoid
Partner - Creator II
Partner - Creator II

I'm not sure if you will be able to populate a list box by dynamically reading the contents of a group.

However, if the contents of the groups are going to be static, you can load an inline table for each one to use to populate the list boxes and then use a macro like the one below, set to trigger when a selection is made on a given list box.

When I tried this I couldn't get a macro to change the active field in a cyclic group, so I chose to have only a single field in the cyclic group and through the macro changed what the field would be.

I know this isn't what you are looking for, but maybe it will help you in finding a solution.


rem --Get the cyclic groups properties
set gp = ActiveDocument.GetGroup("_c_IP_Month").GetProperties
rem --Make the only group Insert date
gp.FieldDefs.Item(0).Name = "Insert_Month"
rem --Set the properties
ActiveDocument.GetGroup("_c_IP_Month").SetProperties gp


Not applicable
Author

All,

Thanks for the help.
I chose Peter's solution as it worked straight forward without coding (besides inline table).

Thank you,
Thilo

Not applicable
Author

Hi Thilo,

You didn't say why you needed this capability in your document but I'm guessing that your report users sometimes don't know exactly which organizational level contains the qualifier they have in mind. You should look at the Search Object (new feature in version 9). For example, if a report user wants to see data only for "children's shoes" but she doesn't know what organizational level will limit the data correctly, then the user can use the search object to search through several predefined fields for the "children's shoes" that she wants to see.

Not applicable
Author

Hello Tim,

I introduced the cyclic group in my reports as I have the situation that the same expressions are often viewed along different dimensions. Rather than providing 3 charts, I provide 1 chart with a cyclic group. The example above (Product, Region, Channel) is a 'real life' example.

I was (and still am) happy with the cyclic group - but 'my' users are not (at least not all of them).
The idea/ the feature 'cyclic group' is very welcome, but the graphical representation (tiny icon) is - according to the users - not user friendly enough.
So I was looking for an alternative, which I hope to have found in the solution above.

Thanks for the hint with the Search box. I can imagine that this improves the overall user experience of my reports, esp. as I have quite a number of fields.

Thank you,
Thilo