Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I'm currently using the below boolean functions to get This Week and Last Week.
-InWeekToDate(Date,Today(),0) as CurrentWeek,
-InWeekToDate(Date,Today(),-1) as PreviousWeek,
For Current Week, it is showing Date as 08/08 and 08/07
and
For Last week, it is showing Date as 07/31 and 08/01.
I want to show Current Week from 08/07 - 08/13
and in the similar way Last week as well.
Can Someone help me in achieving this.
Besides this for Date Range Calculation i would like to use flag
For example, From Aug 1 - Aug 31 (full month Estimation using Flags)
I do not want Max(Date) as i have Dates after Aug 31 2016 as well
I need from Aug 1 2016 and Aug 31 2016 logic using Flags
Thanks
Satish
May be try this:
Table:
LOAD *,
InWeekToDate(Date, WeekEnd(Today()), 0) as CurrentWeek,
InWeekToDate(Date, WeekEnd(Today()), -1) as PreviousWeek;
LOAD Date(MonthStart(Today(), -1) + RecNo() - 1) as Date
AutoGenerate 44;
Try using function InWeek() instead of InWeekToDate().
May be try this:
Table:
LOAD *,
InWeekToDate(Date, WeekEnd(Today()), 0) as CurrentWeek,
InWeekToDate(Date, WeekEnd(Today()), -1) as PreviousWeek;
LOAD Date(MonthStart(Today(), -1) + RecNo() - 1) as Date
AutoGenerate 44;
Both solutions worked...
Thanks
Also how can we get the logic using flags for Date Range.
For example, the data should be displayed from Aug 1 - Aug 31 (Using Flags)
Currently i'm using
InMonthToDate(Date, Today(), 0)
Can i replace the above to
InMonthToDate(Date, MonthEnd(today(), 0) ?
I feel that should work, what do you think Stefan?
It worked . But i will wait for you guys to confirm:)
Best way is to test it out
Using the script:
Table:
LOAD *,
InWeekToDate(Date, WeekEnd(Today()), 0) as CurrentWeek,
InWeekToDate(Date, WeekEnd(Today()), -1) as PreviousWeek,
InMonthToDate(Date, MonthEnd(Today()), 0) as CurrentMonth;
LOAD Date(MonthStart(Today(), -1) + RecNo() - 1) as Date
AutoGenerate 365;
Satish Kurra wrote:
It worked . But i will wait for you guys to confirm:)
?
You want me to confirm what you already proved working? Why that?
It seems you like the more complex functions over the slighty more simple ones, note that there are a lot more functions to create flags for dates in the script, best to have a good read through the relevant date and time functions HELP pages.