BusinessObjects Board

Show saturday and sunday in my cross tab

Hi,

I m crating a report that will be showing the hours worked by every user for two weeks. Everything seem to be fine . The only problem is that, as no one will be working saturday and sunday, these two days will not appear in my report.

I have created a cross tab and it should look like this:


         sunday  monday tuesday wednesday thursday friday saturday
user1               7h
user2                               6h
user3                                                4h
user4               7h
user5
user6

The problem is that I never will have any data for saturday and sunday so the will be not returned in my report.

Any idea to show them. My client want to see them :crazy_face:


zizou :tunisia: (BOB member since 2008-07-31)

Hi,

Please check this Reporter’s FAQ:

It talks about missing months in a cross-tab. So the same technique should be used also in your case where days of a week are missing.


Marek Chladny :slovakia: (BOB member since 2003-11-27)

Hello,

It seams intresting but Dave’s idea seem to be bases on months coming from a celendar table. I have tried seeing my dates coming from the sesond query and there is no date for a saturday or a sunday as no entry have been made for these days.

Regards,


zizou :tunisia: (BOB member since 2008-07-31)

Yes, that’s the point :slight_smile: To find a source of all dimension values that you need in the cross tab.

So the second query can’t be based on a table where there are not all those values. The query needs to be based on a different table. And if you don’t have such table then you may want to use a derived table in the universe where you “make” those values that you need. For Oracle database, the query for such derived table would look like:

select to_char(to_date(trunc(sysdate,'d')-rownum+1),'day') as day_of_week
  from all_objects
 where rownum <= 7
order by rownum desc

Marek Chladny :slovakia: (BOB member since 2003-11-27)

Create 7 columns and hardcore the values sunday, monday…

Create 7 vaiables for measures to show.

vairable1 IF day=‘Sunday’ then SUM(working_hrs)

similarly for others also.


Rakesh_K :india: (BOB member since 2007-12-11)

Hi Marek

I have thaught starting by your idea as it is the most simple to implement.
The problem is that when tring to use your SQL I get an error of syntax.

I have converted your SQL as I m working on SQL server:


SELECT CONVERT(VARCHAR(23), CONVERT(DATETIME, trunc - rownum + 1)) as day_of_week
	FROM  all_objects 
	

	ORDER BY rownum DESC 

Do you think that my code is wrong?

Rakesh: I have tried your idea and it seamed to be excellent but when I try to add any of the days mesures I get multiValue error on some places.

Regards,


zizou :tunisia: (BOB member since 2008-07-31)

Hi,

I am sorry but I don’t know the exact syntax for SQL server.

Maybe something as simple as this might work:

select 'Monday' as day_of_week
union
select 'Tuesday' as day_of_week
union
select 'Wednesday' as day_of_week
union
select 'Thursday' as day_of_week
union
select 'Friday' as day_of_week
union
select 'Saturday' as day_of_week
union
select 'Sunday' as day_of_week

Marek Chladny :slovakia: (BOB member since 2003-11-27)

It works perfectly,

Tahnk you Marek!!! :smiley:


zizou :tunisia: (BOB member since 2008-07-31)

Cool :+1: 8)


Marek Chladny :slovakia: (BOB member since 2003-11-27)

Hi,

trying to continue with my report. I m getting multiValues in some columns. It’s normal and allow me to axplain:

my table look like this now:


            monday    tuesday .....
user1       code1       
              7h
user2                  MultiValue
                          14h
user3       code4
              7h

as you can see for each user, I m showing the hour worked by day and he have to shoose the right code to get paid. The problem is that the user can shoose two codes for one day example for code1 he worked 4h and for code2 he worked 3h

I get a multiValue in every column like that. The Humain resorces have been used to get such reports and for these cases they will be shon like this :


code1|code2
  4h   |  3h

I have been using BO for a good while and I know that show such things in the same cell is impossible but do you think that we can do this.

Regards,


zizou :tunisia: (BOB member since 2008-07-31)

It looks that the [code] dimension is in the body of the cross-tab. Why don’t you move it to the header so its values will be shown across, in the table header?


Marek Chladny :slovakia: (BOB member since 2003-11-27)

Thank you Marek for you Reply

Actually the client whants it like this. So I have converted the dimension to a mesure so that it gets aggregated lik that. It works of the is only one value. but when there is two values, I get multiValues . What I want is to show the two values like this “code1|code2”

regards,


zizou :tunisia: (BOB member since 2008-07-31)

Hi,

You can try using

Min([ code])

or

Max([ code])

instead of just plain

[ code]

Marek Chladny :slovakia: (BOB member since 2003-11-27)

Thank you Very Much Marek!!!

thanks to your idea I thaught of doing this:

in the cell I will do this:

=Min([code])+"
"+Max([code])

it will show me this:

"1037
1400"

Regards,


zizou :tunisia: (BOB member since 2008-07-31)

Hi Marek

as you can see your solution work perfeclty and I have created the view to show all weekdays

the problem is that normally the report is shown on two weeks (users get paid every two weeks) like this:

weekname monday…sunday monday…sunday
day in mounth 1 7 8 14

do youthink that I can modify something to get this result.

as I said. My report works fine but for one week


zizou :tunisia: (BOB member since 2008-07-31)

Just add [day of month] dimension into the header of the cross-tab just below the [day of week] dimension.


Marek Chladny :slovakia: (BOB member since 2003-11-27)

Hi Marek do you mean day of mounth coming from the query one? if so as yhis dimension contains only true data from (monday to friday), it will reduce the days of week dimension and the cross tab will contain only monday to friday

Regards,


zizou :tunisia: (BOB member since 2008-07-31)

Hi,

Do you have a calendar table? This sort of things that you are trying to implement are easier done using a calendar table. If you don’t have it, consider creating one.


Marek Chladny :slovakia: (BOB member since 2003-11-27)