Forum Discussion
Flag in Calendar
- 4 years ago
Hi Stabben23 ,
Please try the column:
Flag = VAR currentDay = TODAY () VAR IsMonday = IF ( [Date] < currentDay, 1, 0 ) VAR IsNotMonday = IF ( WEEKNUM ( currentDay, 2 ) = WEEKNUM ( [Date], 2 ), 1, 0 ) RETURN IF ( WEEKDAY ( currentDay, 2 ) = 1, IsMonday, IsNotMonday )If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Stabben23 , not very clear, but for a month day based week you can flag like
Week Type =
var _st = today() +-1*WEEKDAY(today() ,2)+1
var _end = today() + 7-1*WEEKDAY(today(),2)
return
Switch( True(),
[Date] >= _st && [Date] <= _end ,"This Week" ,
[Date] >= _st-7 && [Date] <= _end -7,"Last Week" ,
[Week Name]
)
or
Week Type =
var _st = today() +-1*WEEKDAY(today() ,2)+1
var _end = today() + 7-1*WEEKDAY(today(),2)
return
Switch( True(),
[Date] >= _st && [Date] <= _end ,1 ,
[Date] >= _st-7 && [Date] <= _end -7,0
)
Thanks for answer, if I use your
Week Type =
var _st = today() +-1*WEEKDAY(today() ,2)+1
var _end = today() + 7-1*WEEKDAY(today(),2)
return
Switch( True(),
[Date] >= _st && [Date] <= _end ,0 ,
[Date] >= _st-7 && [Date] <= _end -7,1
)
and change place on 1 and 0 I get what I want for now as you see in my table. But Tomorrow it should change so All 1 gets 0 and All 0 get 1 because its Thuesday, will that work dynamic?