Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
I have a pivot table which shows the data from start of the year to the end of the year. What I need is this chart by default it should show the future data only.(i,e) DateField >= today(). May I know how to achieve this with the help of trigger?
Thanks
Attitude
I think you could use a trigger on opening of the document (see document properties trigger) or OnActivateSheet (see sheet properties) to set the DateField to today's date.
For example, go to document properties, triggers. Select an OnOpen event trigger with action Select - Select in field.
use
DateField
as field (as is, no equal sign), and
='=sum({<Date = {">=$(=today())"}>}1)'
as search expression.
This will affect all objects that are affected by DateField.
Or you make use of a set of additional variables / data island field, with two states: default (today), free selection and use these states within your pivot table object to limit your DateField if requested. Like above, the trigger would set the state to default on Opening of document or activation of sheet.
Hi
I tried with the solution that you have provided but it didn't workout. Can you please provide some other solution.
Thanks
Attitude
Which solution have you tried out? Since I think the solution does work, it would be nice if you could give some more information about what you tried.
Attached a demo of the OnOpen document trigger and selecting the dates >= today.
I think it works, doesn't it?
Stefan
(To demonstrate it, clear selection, save and close the app, start the app).
swuehl solution should work, but only if your Date field has the the same format as the trigger.
To make sure that your date-field always is the same format as the expression you want to compair (or calculate) with. Best way to know this is to make 2 text object.
Text object one:
=Today()
Text object two:
=MAX(Datefield)
If the results have not the same formats it will not work.