- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to make a data selection trigger?
Hello,
We have an application where customers can make 2 types of purchases - lets call them balls and sticks, the field is called 'SaleType'.
I would like to activate a trigger so when a user opens a particular sheet, only customers who have purchased both balls and sticks are selected.
Any guidance is appreciated.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Maybe with something like this as search-expression within a the trigger:
= '("' & concat({< SaleType = {'balls'}> * < SaleType = {'sticks'}>} distinct customer, '"|"') & '")'
- Marcus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you sure that a trigger is the best way to do this? I would use set expressions that filter for both balls and sticks, rather than a triggered selection.
In a chart/table, something like
Sum({<Customer = P({<SaleType = {'balls'}>*<SaleType = {'sticks'}>} Customer)>} Sales)
(although its easier to develop and test something like this if you provide a sample qvw file)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sheet on which you want to select the customers, go to sheet properties-> Triggers -> Add Action on Activation of sheet -> Add->Selections->Select in Field->
Field : Customer
Search Staring : ='(' &concat(distinct {<SaleType={'Balls'}>*<SaleType={'sticks'}>} chr(34) & Customer & chr(34)) &')'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So I haven't had much luck with this. I have tried a few things using the suggestions above.
Right now as a trigger I have:
='(' &concat(distinct {<ROCKApplication={'AGG'}>*<ROCKApplication={'Fill'}>} chr(34) & %customer & chr(34)) &')'
on the field %customer
However, when the sheet is activated, I cannot see anything in the 'Current Selections Box'.
Should this appear in the current selection box?
I have tried another trigger, on a different field, and in the Search String i just have (AGG|Fill) and while it does not accomplish what i am trying to do, at least in the current selections box i can see that these fields have been selected.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try this
='(' &concat(distinct {<ROCKApplication={'AGG'}>*<ROCKApplication={'Fill'}>} chr(34) & %customer & chr(34), ', ') &')'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The delimiter for the dimension-values needs to be the pipe-sign '|' and not the comma.
- Marcus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think with single quotes and comma its works. Not sure
='(' &concat(distinct {<ROCKApplication={'AGG'}>*<ROCKApplication={'Fill'}>} chr(39) & %customer & chr(39), ', ') &')'