Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi all,
I have a request to show sales amount on the second Sunday of each month. I have a date cloumn that has all dates in it.. is there a way to define the second Sunday in each month with a flag?
Best,
Alec
thank you Sunny..
I tried something simpler and worked for me
if(Weekday([Date])='Sun' and day([Date])>7 and day([Date])<=14, 1,0) as SecSunFlag,
May be something like this:
Table:
LOAD *,
If(CumSundayFlag = 2 and SundayFlag = 1, 1, 0) as [2ndSundayFlag];
LOAD *,
If(Month = Previous(Month), RangeSum(Peek('CumSundayFlag'), SundayFlag), SundayFlag) as CumSundayFlag;
LOAD *,
Month(Date) as Month,
If(WeekDay(Date) = 'Sun', 1, 0) as SundayFlag;
LOAD Date(MakeDate(2014, 1, 1) + RecNo()-1) as Date
AutoGenerate MakeDate(2016, 1, 1) - MakeDate(2014, 1, 1);
DROP Fields CumSundayFlag, SundayFlag;
thank you Sunny..
I tried something simpler and worked for me
if(Weekday([Date])='Sun' and day([Date])>7 and day([Date])<=14, 1,0) as SecSunFlag,
Great ![]()
It is indeed simpler.
Hey, It is giving me Script Line error for this.