Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
datanibbler
Champion
Champion

Triggers to make selections "repeat" - and take them off?

Hi,

I have to display "unplanned absenteeism" which defines as

=> all employees (in a given area) who have not checked in on a certain day, but who don't have a holiday (as per the database)
     and who are not recorded sick in the database, either.

=> I have several tables (one for the checking_data, one for the sick_flags, one for holidays), with three fields generated via Applymap each (the plant, the bigger_area and the area)

=> These fields have different names in the three tables to avoid synthetic keys.

=> I have set up triggers that "repeat" user-selections on one set of these fields for the others. That direction works fine

<=> Those triggers don't serve to remove those selections when the user takes off the selections on the primary set of data, which
      leads to wrong data, of course.

=> Is there a way I can set like triggers to take off those "repeated" selections when the user takes off his? I cannot tell from the dialog from what the buttons say. (I have those "repeater" selections set via the button "on selection")

Thanks a lot!

Best regards,

DataNibbler

7 Replies
marcus_malinow
Partner - Specialist III
Partner - Specialist III

Hi,

if I were you I'd be inclined to amend the data model.

Either create a link table with them, or a single fact table.

Marcus

datanibbler
Champion
Champion
Author

Hi Marcus,

yes, I guess that might be the easiest - and most elegant - way of solving this issue. A link table is something I haven't used before, so here we go...

Thanks!

Best regards,

DataNibbler

marcus_malinow
Partner - Specialist III
Partner - Specialist III

Hi DataNibbler,

you've probably already seen this blog post, but just in case. You may find it useful.

http://community.qlik.com/blogs/qlikviewdesignblog/2013/05/17/concatenate-vs-link-table

Marcus

Not applicable

Document Properties > Triggers > Actions> Add

Action Type: Selection
Action: Select in Field
Field; "Your Field"
Search string: "Leave Blank"

Do this before or after your main action for the field/s you want to clear.

datanibbler
Champion
Champion
Author

Hi obs12345,

I don't really see how I could do this - upon a selection on, say, field1, a selection on both field2 and field3 is triggered - and you propose adding a second action on "selection"? I don't think that would work - we had similar scenarios before and QlikView seemed to mess up the order in which to execute triggers so the results were b*... (we had a trigger in qvw1 to a) call qvw2 and b) close the app - but QlikView doesn't let you specify which app to close and the result was that QlikView apparently opened qvw2 and closed it right away...

However, I think I will go with Marcus' suggestion. That seems to be the more elegant solution.

I just learned that all the base_data will look all different next year, anyway... I think I will spend the train_ride home with having a nervous breakdown...

Best regards,

'DataNibbler

Not applicable

From what I understand you seem to want an on off switch.


Another way would be to set a variable with the value of the user selection. Then push this value into the "Select in Field"  Action.

1. Create a variable in the normal way. eg. vToggle Leave value as blank

2. Set your variable. Right click on the object properties > Actions > Add > External > Set Variable

Variable: vToggle

Value: "Your Field"

3. Set Document Properties > Triggers > Variable Event Actions> Add Action Oninput

4. Action Type: Selection

Action: Select in Field

Field; "Your Field"

Search String: "Leave Blank"

5.

Action Type: Selection

Action: Select in Field

Field; "Your Field"

Search string: vToggle

datanibbler
Champion
Champion
Author


Hi obs12345

I'm really not sure about what would be the best way to do it - yours looks good while working with a link_table would be more elegant - in this instance, however, I'm probably going with your proposal as it looks like the one causing me the least effort - it's all going to change on Jan 02, so I'm not going into great works now...

Only one more question, sth. I don't quite understand in your last post:

- The variable and all that is pretty clear.

- Then I should add to actions "on input - one selection without a value and one with the value of the variable?

I just hope this will work - I told you we once had a case where QlikView seemingly messed up the execution_order of several actions to trigger so that the actions annulled each other... Well, I will test it - both here in the client_software and on one of our TB_machines in IE - there can be differences as we've found out.

Thanks a lot!

Best regards,

DataNibbler

P.S.: I guess that in the HR_app I could do with a link table in the medium run since the Personell_ID is always the same of course and I load a number of tables, each with this ID as keyfield and currently I name it differently in all the tables...

But this kind of fine-tuning and performance-optimizing has to wait until the rollout is done.