Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a project where I have to display current week data by default(i.e. 11/17/2014- 11/21/2014), I worked with Default Day and Month for which I used Month(Today(1) and Day(Today(1)) worked with no issues. But now I use Week(Today(1)) for week and end up with integer value of current week.
Any help would be appreciated.
Thanks!!
Create Two Variables
vCurrentWeekStart
=Date(WeekStart(Today()))
vCurrentWeekEnd
=Date(WeekEnd(Today()))
Now go to Settings - Document Properites - Document Event Triggers - On Open Trigger
Add Actions
Add
Selection - Select in Field
Field
Date
Search String
='>='&vCurrentWeekStart &'<='&vCurrentWeekEnd
Now whenever you open this document, by default the current week dates will get selected...
==============================================
If you want SUM(Sales) for current week, use as below
=SUM({<Date = {">=$(=WeekStart(Today()))<=$(=WeekEnd(Today()))"}>}Sales)
Hope anyone from above would be the same you are looking for...
Try the below:
=Date(Min({<Date={"=week(Date)=week(Today())"}>} Date)) & ' - ' & Date(Max({<Date={"=week(Date)=week(Today())"}>} Date))
If you still want to be able to click around in the Date field you can use set analysis:
=Date(Min({<Date={"=week(Only({1} Date))=week(Today())"}>} Date)) & ' - ' & Date(Max({<Date={"=week(Only({1} Date))=week(Today())"}>} Date))
Hi,
I'm not sure understand but I'll using a variable vCurrentWeek = Week(Today()), for example if I need my sales of actual week, I use next expression:
Sum({${<Week={$(vCurrentWeek)}>}}Sales)
or if you don't use a variable try:
Sum({${<Week={$(#=Week(Today()))}>}}Sales)
or if you don´t have a week field try
Sum({<Date= {">=$(=WeekStart(Today()))<=$(=Date(WeekEnd(Today())-2))"}>} Sales)
Regards.
Create Two Variables
vCurrentWeekStart
=Date(WeekStart(Today()))
vCurrentWeekEnd
=Date(WeekEnd(Today()))
Now go to Settings - Document Properites - Document Event Triggers - On Open Trigger
Add Actions
Add
Selection - Select in Field
Field
Date
Search String
='>='&vCurrentWeekStart &'<='&vCurrentWeekEnd
Now whenever you open this document, by default the current week dates will get selected...
==============================================
If you want SUM(Sales) for current week, use as below
=SUM({<Date = {">=$(=WeekStart(Today()))<=$(=WeekEnd(Today()))"}>}Sales)
Hope anyone from above would be the same you are looking for...
Do be aware that On Open Triggers do not work with the Ajax Client, only with the IE Plugin
I use Manish's idea all the time and have yet to experience issues with triggers and Ajax.
it works perfect,but i have 6 sheets and they should have default week view.
Does the on Open document trigger works for all sheets or do i have to use sheet triggers??
I prefer to use On Open document trigger.
Hi,
Open document trigger is applied once when the document is opened, after that if you clear the selections it won't retain, if you want to retain in every sheet then you have to use Sheet Triggers. This all depends on your requirement, if you just want when opening the document just use Document Trigger or if you want to retain every time when the sheet is loading then use Sheet Triggers.
Hope this helps you.
Regards,
Jagan.
Got it..
Thanks!!