Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi there,
I need your help to solve my issue, i need to count saturdays in date range:
I have a field with date (Format: DD/MM/YYYY hh:mm:ss) and i make filters in diferents range but i need only count how many saturdays exist into this range selected (the range is variable).
Thanks for all!.
Thanks in advance.
You have changed the system variable FirstWeekDay, which influences Weekday() function.
You can correct this like
Div(WEEKDAY(Min([Creation Time])-6,0)+1-Min([Creation Time])+Max([Creation Time]),7)
Maybe like shown here
Re: Count of Saturday in whole month
=Div(WEEKDAY(Min(DateField)-6)+1-Min(DateField)+Max(DateField),7)
in script;
aa:
load *,
WeekDay(data) as week_name;
load * inline [data
1/1/2016
2/1/2016
3/1/2016
4/1/2016];
and in interface
count(distinct if(week_name='Sat',data))
Does not work!
Div(Date2-Date1,7) + (WeekDay(Date1)<=5)*(WeekDay(Date2)>=5)
'Does not work' is not a really helpful issue description.
Do you get an error, no value, wrong value?
(I assume you have replaced DateField with the field name of your date field).
See attached a sample QVW.
see this attach
Does not work, this formule is counting 1 with any saturdays selected.
Maybe try,
Count(If(Weekday(DateField)='Sat',1))
Hi, I suggest to use additional field with number of weekday, which we have to add in the load script. And than you can use expression like this "Count({<WeekDayField = {5}>} DISTINCT DateField)". We have to use integer values in DateField. That's why we should use transformation for it: Floor(BaseDateField).