Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I want to display the dimension as current week like below
My date field is Tran_Date
Day1
Day2
Day3
Day4
Day5
Day6 this is current week except sunday
how can I write the calculation condition?
Try this,
Backend
Temp:
Load * inline [
Date, ID
6/1/2018,2
6/2/2018,2
5/31/2018,2
5/30/2018,2
5/29/2018,2
5/28/2018,2
5/27/2018,2
5/26/2018,2
5/25/2018,2
5/24/2018,2
];
NoConcatenate
load *,
weekday(Date) as Weekday,
num(Date)as Numdate,
if(weekday(Date) = 'Sun',0,1) as sunday_flag
Resident Temp;
drop table Temp;
exit script;
frontend
char dimension as Weekday
expression as-
Count({<Numdate = {">=$(=num(WeekStart(Max(Numdate),0)))<=$(=max(Numdate))"}, sunday_flag = {'1'}>}ID)
Can you try this?
Does this helps?
if you want to show the days as Day 1, Day2...
then use this as a dimension-
Pick(match(Weekday,'Mon','Tue','Wed','Thu','Fri','Sat'),'Day1','Day2','Day3','Day4','Day5','Day6')
In this case please close your other thread.
thanks
regards
Marco