Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How can I select 1 specific field in a Cycle Group?

Dear all,

I have a chart with a cycle group. The thing is that once I go to the Main sheet I would like to have always one specific field of the cycle group displayed by default.

For example, if I work in the main sheet and select the "Place of birth" in the cycle group, then I go to the Sheet1, I would like that the next time I go back to the Main sheet the Name field of the cycle group to be displayed and not the last time selected one.

I have tried with: sheet event triggers --> trigger --> OnActivate Sheet --> Add Action Select in field --> Field  =GetCurrentField(Test) = 'Name' without success.

I have also thought about creating a macro that could select this field in the cycle group.

Find attached the qlikview document.

Thank you in advance.

1 Solution

Accepted Solutions
Not applicable
Author

I just got the answer.

My cycle group has the following fields:

  • Name
  • Place of Birth
  • Surname

The macro that tresesco suggested would jump 1 field.

So what I did was to add in the macro another line that would jump 2 fields. Therefore, if "Place of Birth" is selected in the cycle group will jump 2 fields, and if the selection is Surname will jump 1 field, always seeing by default the Name field in the sheet "Sheet1"

View solution in original post

8 Replies
Not applicable
Author

Thank you tresesco, but the post you are refering to was not closed.

I watched the video but it does not activate a specific field of the cycle group but creates a button with the same functionality as the cycle group icon.

c_gilbert
Creator II
Creator II

I'm not sure how you would do this with triggers (so I'll be keeping an eye on this thread out of curiosity), however if you change the order of the fields in the Cyclic group so that the one you always want as default is at the top, it will always show this one first.

Not applicable
Author

Thank you Charlotte,

I can change the order of the fields. However, if I select a field that is not the first one, the selection will be mantained and it will not go back to the first field.

tresesco
MVP
MVP

Could work out an alternative. Used a sheet trigger:

=If(GetCurrentField(Test)<>'Name', 'SetGField')                      //SetGField is trigger

Sub SetGField
    groups=ActiveDocument.GetGroups
    groups(0).Cycle 1
End Sub

The trigger is set to act on the same macro multiple times(for your case two times because you have three fields in the group) so that it reaches to your desired field.

PFA

Not applicable
Author

Thank you tresesco,

But if in Sheet1 I Select Place of birth, go to main sheet and go back to sheet 1, it will show Surname and not Name. It will move one cycle group but no twice as it should to reach Name field.

Do you think there is a way to select a specific field in a cycle group? In this case name.

Thank you.

Best regards.

Not applicable
Author

I just got the answer.

My cycle group has the following fields:

  • Name
  • Place of Birth
  • Surname

The macro that tresesco suggested would jump 1 field.

So what I did was to add in the macro another line that would jump 2 fields. Therefore, if "Place of Birth" is selected in the cycle group will jump 2 fields, and if the selection is Surname will jump 1 field, always seeing by default the Name field in the sheet "Sheet1"

koresaket
Contributor II
Contributor II

I need to apply the same functionality on drill down group. Please suggest me some solution.