Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Conditional Display of a field in join dataset
Dhanya
Hi,
I am trying to display Timeseet report in RTC 3.0.1 using BIRT.
Here the report requires to display the weekending date.
The weekending date in BIRT can be Sunday or Saturday.
We have this funtion BirtDateTime.weekDay(row["startDate"],1) to calculate which day in a week is a particular day.
For example: BirtDateTime.weekDay(Nov 11,1) would be 6. And to calculate the weekending date considering Saturday would be Weekend, We have the function as
row["startDate"]+ (7 - BirtDateTime.weekDay(row["startDate"],1)) = Nov 11 + 7 - 6
= Nov 12
But here the report requirement says the week ending date should be Friday!!!!
When a day is anything other that Saturday, the weekending date calculation is easy.
row["startDate"]+ (6 - BirtDateTime.weekDay(row["startDate"],1))= Nov 11 + 6 - 6 = Nov 11
But when it comes to Saturday, we have to get the next Friday.
row["startDate"]+ 6. Example when it is Nov 12, the weekending date should be coming Friday which is Nov 18.
My tables are join of more than one table. And here based on the Weekday I have to calculate the value the weekending date. Script on the table is not possible as it is a joint dataset. I have tried the script for the specific field of the table which is not working.
Mapping using conditions also not working.
I am sure this is a small problem and can be resolved.
Please let me know if I need to put more data here for examples.
Thanks
Dhanya
Find more posts tagged with
Comments
lrnrit
<blockquote class='ipsBlockquote' data-author="'Dhanya'" data-cid="85521" data-time="1321867174" data-date="21 November 2011 - 02:19 AM"><p>
Hi,<br />
<br />
I am trying to display Timeseet report in RTC 3.0.1 using BIRT.<br />
Here the report requires to display the weekending date.<br />
The weekending date in BIRT can be Sunday or Saturday. <br />
<br />
We have this funtion BirtDateTime.weekDay(row["startDate"],1) to calculate which day in a week is a particular day.<br />
<br />
For example: BirtDateTime.weekDay(Nov 11,1) would be 6. And to calculate the weekending date considering Saturday would be Weekend, We have the function as<br />
<br />
row["startDate"]+ (7 - BirtDateTime.weekDay(row["startDate"],1)) = Nov 11 + 7 - 6<br />
= Nov 12<br />
<br />
But here the report requirement says the week ending date should be Friday!!!!<br />
<br />
When a day is anything other that Saturday, the weekending date calculation is easy.<br />
row["startDate"]+ (6 - BirtDateTime.weekDay(row["startDate"],1))= Nov 11 + 6 - 6 = Nov 11<br />
<br />
But when it comes to Saturday, we have to get the next Friday.<br />
row["startDate"]+ 6. Example when it is Nov 12, the weekending date should be coming Friday which is Nov 18.<br />
<br />
My tables are join of more than one table. And here based on the Weekday I have to calculate the value the weekending date. Script on the table is not possible as it is a joint dataset. I have tried the script for the specific field of the table which is not working. <br />
Mapping using conditions also not working.<br />
<br />
I am sure this is a small problem and can be resolved.<br />
<br />
Please let me know if I need to put more data here for examples.<br />
<br />
Thanks<br />
Dhanya<br /></p></blockquote>
<br />
<br />
Hi<br />
<br />
how are you showing this data in your report . In Table or something else. Put some example of data what you want to show.<br />
<br />
lrnit
Dhanya
Hi,
The data displayed is through a joint table and it has the following format.
Summary_Task/Task_Details/Start_Date/Time_spent/resource_name/Week_Ending_Date
Object1/Review Code/Nov 11/4/Dhanya/Nov 11
Object1/Testing/Nov 16/5/Dhanya/Nov 18
The trouble is for getting the last field.
When the Start_Date is a Saturday I have to display the next Friday.
Since this is a joint dataset, the scripts are not allowed at the table level and this complicates the matter. I tried putting a condition to check if the Start_Date is a saturday on the 'On Prepare', 'On Create' and 'On Render' methods of that cell but did not work out.
Thanks
Dhanya
Dhanya
Michael,
Will you be able to help?
Thanks
Dhanya