Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
Hi all,
anyone know how to set summary values for weekend (saturday & sunday) and weekday (monday till friday) for every week. so i want to know summary value (for example: sales) in this this week, which I separate the summary into weekend and weekday.
thanks before
.png) 
					
				
		
 Miguel_Angel_Ba
		
			Miguel_Angel_BaHi,
You can use the WeekDay() function in your script, in the same place where you have the date field, and create a new flag field
If(WeekDay(DateField) > 0 AND WeekDay(DateField)<6, 1, 0) AS WorkDay
To get the sales on weekends
Sum({< WorkDay = {0} >} Sales)
And to get the sales on normal days, same expression but 1 instead of 0
Sum({< WorkDay = {1} >} Sales)
Hope that helps.
Miguel
.png) 
					
				
		
 Miguel_Angel_Ba
		
			Miguel_Angel_BaHi,
You can use the WeekDay() function in your script, in the same place where you have the date field, and create a new flag field
If(WeekDay(DateField) > 0 AND WeekDay(DateField)<6, 1, 0) AS WorkDay
To get the sales on weekends
Sum({< WorkDay = {0} >} Sales)
And to get the sales on normal days, same expression but 1 instead of 0
Sum({< WorkDay = {1} >} Sales)
Hope that helps.
Miguel
 
					
				
		
thanks miguel for your help, and it work now, but with a bit modification:
If(WeekDay(OrderDate) > 0 AND WeekDay(OrderDate)>=5,1,0) AS WorkDay
so, i use this expression : Sum({< WorkDay = {0} >} Sales) for workday, and Sum({< WorkDay = {0} >} Sales) for weekend.
thanks
