Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dates with no data required on crosstab

Status
Not open for further replies.

AnnetteB1305

Technical User
Aug 17, 2011
166
GB
Hello,

I posted this on other topics but not sure if this should be in this forum

I have a report to amend that has a crosstab and a graph. I did have to do the crosstab with an additional manual crosstab addition also.
My graph is On change of @logdate then show values of sum of @callcount, sum of @callsexclthirdparty, sum of @closedcalls and @avgcalls

The formulas are as follows:-
@logdate=If date({tablename.logdate}) >dateadd("d",-8,CurrentDate)then date({tablename.logdate}) else Date({@null})

@callcount is If date({tablename.logdate}) >=dateadd("d",-8,CurrentDate) then 1 else tonumber({@null})

@callsexclthirdparty is If {tablename.suppgroup}<>'_THIRDPARTY' and date({tablename.logdate}) >= dateadd("d",-8,CurrentDate) then 1 else tonumber({@null})

@closedcalls is If {@Closedate}={@logdate} and date({tablename.logdate}) >=dateadd("d",-8,CurrentDate) then 1 else tonumber({@null})

@avgcalls is If (date({tablename.logdate}) in dateserial(year(currentdate),month(currentdate)-1,day(Currentdate)-8) to
(dateadd("d",-8,CurrentDate))) then Sum ({@Day1MthCallCount})/31 else
If (date({tablename.logdate}) in dateserial(year(currentdate),month(currentdate)-1,day(Currentdate)-7) to
(dateadd("d",-7,CurrentDate))) then Sum ({@Day2MthCallCount})/31 else
If (date({tablename.logdate}) in dateserial(year(currentdate),month(currentdate)-1,day(Currentdate)-6) to
(dateadd("d",-6,CurrentDate))) then Sum ({@Day3MthCallCount})/31 else
If (date({tablename.logdate}) in dateserial(year(currentdate),month(currentdate)-1,day(Currentdate)-5) to
(dateadd("d",-5,CurrentDate))) then Sum ({@Day4MthCallCount})/31 else
If (date({tablename.logdate}) in dateserial(year(currentdate),month(currentdate)-1,day(Currentdate)-4) to
(dateadd("d",-4,CurrentDate))) then Sum ({@Day5MthCallCount})/31 else
If (date({tablename.logdate}) in dateserial(year(currentdate),month(currentdate)-1,day(Currentdate)-3) to
(dateadd("d",-3,CurrentDate))) then Sum ({@Day6MthCallCount})/31 else
if(date({tablename.logdate}) in dateserial(year(currentdate),month(currentdate)-1,day(Currentdate)-2) to
(dateadd("d",-2,CurrentDate))) then Sum ({@Day7MthCallCount})/31 else
If (date({tablename.logdate}) in dateserial(year(currentdate),month(currentdate)-1,day(Currentdate)-1) to
(dateadd("d",-1,CurrentDate))) then Sum ({@Day8MthCallCount})/31 else 0

My problem is the customer now wants to do this report for other customers who don't make calls at the weekend but they still want to show the dates and the report is not working to this requirement. i.e if there are no calls on the date then it doesn't show anything the date in the graph or the crosstab.

Can anyone help with this one, I had a similar problem with another section of the report but I just was able to amend the selection to show all data and then amend the formula to display however this isn't the solution for this part as need to have a months worth of data in the selection because the months average is required.

Thanks in advance

Annette
 
Also Posted Here: thread149-1661189

Mike
---------------------------------------------------------------
"To be alive is to revel in the moments, in the sunrise and the sunset, in the sudden and brief episodes of love and adventure,
in the hours of companionship. It is, most of all, to never be paralyzed by your fears of a future that no one can foretell."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top