Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Trigger to set Group current field on open document

Hi guys,

How do I create a trigger to set the current field of a group when opening the document?

Thanks,

Aldo.

8 Replies
thomas_wang
Creator
Creator

Hi All,

I have the same question. Is there any ideas?

Thanks!

balabhaskarqlik

Do like this:

Go to Settings -> Document Properties -> Triggers

Select the “OnOpen” trigger and press “Add Action”

Add the Select in Field Trigger (section Selection)

Ex: Field - year

Search String: = max(year)

Now, go to the list box properties and select "Always one selected value" in general tab of the list box properties.

One thing to note here is that if you go by Always one selected value, then you will never be able to select more than one year. (for example you can not select 2010 and 2011 both).

So, it all depends your requirement, but always one selected mode should be preferred over triggers.

rakeshkumar1890
Creator
Creator

Hi Liaks,

I think on document you have created group with two or more fields in which on that field you have applied some logic, In that case you can create variable for that field with logic and can apply Document trigger to OnOpen option.

thomas_wang
Creator
Creator

Hi Bhaskar,

What I want to set is the activated field in the group, not a selection in the field.

You may know a function called GetCurrentField(). What I want now should be a “SetCurrentField()” function.

You may have misunderstood me, or I didn't understand you.

Thank you anyway.

thomas_wang
Creator
Creator

Hi Kumar,

According to my personal understanding, what you offer is an alternative?

Is there any way to preserve the original built-in group mechanism and implement the original requirements?

Thanks!

balabhaskarqlik

May be add that function, in Search string area of the Action.

thomas_wang
Creator
Creator

A Group is not a Field and cannot be recognized in Select in Field Trigger.

Thanks.