Current week in report page
Hi Firends,
I have to write a logic to display in the page whats the current week for this year. I mean if i am talking about 2nd of june 2011, how can i calculate and display what week 2nd june falls in
Regards
Hi,
User_Apex wrote:
Hi Sybrand Bakker
I tried this and its showing week 23 but your query is showing as week 22. Please run this and let me know the difference. Thanks in advance
SELECT ceil(( 7+(trunc(sysdate,'d')-trunc(sysdate,'Y')) )/7) FROM DUAL;(a) That gets the week number based on the calendar year, which begins on January 1.
ISO Years begin on the Monday closest to January 1 (e.g., Monday, January 3, 2011).
(b) TRUNC (dt, 'D') is dependent on your NLS settings.
TO_CHAR (dt, 'IY') (or TRUNC (dt, 'IY') does not depend on your NLS settings.
(c) Using CEIL (( 7 + ...))) means you'll add a week to the results when dt is not the same day of the week aTRUNC (dt, 'Y'). If you want to use the approach above, you'd be better off using 1 + FLOOR (...)
Any of the above could cause differences between Sybrad's approach and yours. In this case, it seems to be (c).
If you want a result based on the calendar year and your NLS settings, then TO_CHAR (dt, 'WW') could be it.
No kidding, we could help you a lot more if you posted some sample data (CREATE TABLE and INSERT statements), results, and an explanation of how you get those results from that data (e.g., what a "week" means in this context).
Similar Messages
-
Create an Activity Report for Current Week
I would like to create a activity report for the current week. The trick is that if the weekday is Wednesday or earlier (Sunday being the first day of the week), the report shows last week's activities; but if the weekday is Thursday or later (Saturday being the last day of the week), the report shows the current weeks activities.
I have a filter that works in Access but does not seem to work in Siebel. It does just what I explained above:
Between CDate(Int((IIf(Weekday(Now())<=4,Now()-(6+Weekday(Now())),Now()-(Weekday(Now())-1))))) And CDate(Int((IIf(Weekday(Now())<=4,Now()-Weekday(Now()),Now()+(7-Weekday(Now()))))))
Thank you,
David
Edited by: DavidE on Oct 7, 2008 4:17 PMDavid,
try this:
case DAYOFWEEK(CAST(Activity."Planned Start Time" AS date))when 1 then timestampadd(sql_tsi_day,1,CAST(Activity."Planned Start Time" AS date)) when 3 then timestampadd(sql_tsi_day,-1,CAST(Activity."Planned Start Time" AS date)) when 4 then timestampadd(sql_tsi_day,-2,CAST(Activity."Planned Start Time" AS date)) when 5 then timestampadd(sql_tsi_day,-3,CAST(Activity."Planned Start Time" AS date)) when 6 then timestampadd(sql_tsi_day,-4,CAST(Activity."Planned Start Time" AS date)) when 7 then timestampadd(sql_tsi_day,-5,CAST(Activity."Planned Start Time" AS date)) else CAST(Activity."Planned Start Time" AS date) end
This gave me the sunday of the week. You should be able to modify this format for your purposes.
cheers
Alex -
Report Issue: Previous Weeks, Current Week and Next Week Values
Hello Folks,
this is a typical requirement...at-least typical for me..
we have 20 weeks of data at weekly level. we have four Metrics out of which two are coming from Database and rest two are calculated metrics.
Metric0: On Hand Qty
Metric1: Past Qty
Metric2: sell Qty
Metric3: unsell qty
Metric4: Total Qty
the report will always be shown for 20 weeks, but depending on whats my current week, all the past weeks should be flagged as Past Week. (so i wrote a case statement for this). for Instance: I am in Week11, so my weeks in should be Past Week, Wk11, Wk12.........Wk20.
Metric 1 is always dependent on result of Metric4 (This is the Complexity) per week basis
Metric1 for Past weeks value in Week Column will be wk1 to wk10 On Hand Qty (fox ex: 80)
Metric4 for Pass Weeks Value in Week Column will be Metric1 for Pastweeks + Metric2 for Past Weeks (For Ex: 20) (Past weeks mean wk1 to wk10)
value of Metric4 is now 100
Metric1 for Week11 Now should 100 (From Past weeks Calculation)
Metric4 for Week11 will be Metric1 for Week11(100) + Metric2 for Week11(10) + Metric3 for Week11 (10)
Now...Metric1 for Week12 will be 120 which is wk11 total (100+10+10) and goes on Until Week 20
Any Ideas how to achieve this in obiee 10g
Thanks
RakePlease try out in this way....
Database level --Create opaque view & procedure or function to get the week total,week ago total, current week , Past week ,future week & do rpd modelling and use PIVOT VIEW.
At answers:
1.Here Previous week M4 is the current week M1 which means it is a cumulative value carried forward week by week.
2. M2 & M3 are direct database columns.
3. You have time hierarchy with WEEK Level.
M1 - ago(rsum(m2+m3),weeklevel)
M4- RSUM(M2+M3)
week -AGO(RSUM(M2+M3)- M2-M3-RSUM(M2+M3)
w1-0-10-20-30
w2-30-11-21-62
w3-62-12-22-96
Now you can PIVOT IT to get in
W1-W2-W3
M1 0 - 30-62
M2 10-11-12
M3 20 -21-22
M4 30 - 62-96
NOW PASTWEEK (W1-W10), CURRENT WEEK(W11)-W12
1.as you see cumulative here you need to use BINS.means ( case when week <= currentweek(maybe variable) then prior) else week)
2. UNION - combine similar request - First cirteria week <= w11 and second criteria week > week 11 --combine pivot it. Use sum agg in fx criteria1.
Hope this should solve your pblm at answers.
Edited by: MK on Oct 27, 2011 12:48 PM -
Hi All,
There is a requiremnet to create a report that will contain the total amount due to and from of vendor ,the amount due in the
current week. i am using BSEG table.
Couid you please guid me to how to get the current week report when ever runs. from monday on words.Hi Raju,
It is possible by getting input as from date and end date from the user.
For that u can use Selection screen to get From and To date.
With that write a Query to fetch neccessary details from table .
I write an example
select * from lfa1 where date in weekdate.
The week date should be declared as
Selection-screen: weekdate in type <datefield type in table>
The query will fetch the datas in between the dates given -
Weekly status report in SharePoint 2013
Hi
guys.
I
recently found a link that showed how to create a weekly status report in SharePoint 2010 using wikis: http://blogs.c5insight.com/Home/tabid/40/entryid/200/Creating-a-Weekly-Team-Status-Report-in-SharePoint-2010-Using-Wikis.aspx
I
am new to sharepoint and currently I am using sharepoint 2013.
I
created a wiki page library and the library contains wiki pages for every team member so
that each member can enter their own status information in it.
Now I would like to create a form inside the wiki page in which users
can submit their status reports on a weekly basis and then submit that.
The submitted information must be stored in a way (may be a document)
so that it can be reviewed by senior management. Also, I need a way to archive past
weekly status reports.
Can
someone guide me on this?
Thanks,
AnkitYou need to create a custom list with appropriate fields. Set up security so people can only see the items they have created. You can create a workflow in SharePoint Designer that alerts the appropriate people who need to approve it. Then, you can
edit a Wiki page and drop the list's web part on to the page. -
How do I run query per report page?
I have a report with two subreports which both need queries to run on the fly per supplier(per report page). All the other subreports on the page as well as the main report queries are loaded in advance before the report and includes all records needed for all suppliers. However, these two querys that I'm trying to have run per report though can only be loaded one at a time because of the way these queries are formated (it allows a bar graph to show a label for only the current supplier on the x-axis and all other suppliers will display a "" for x-axis label, effectively only showing one legend label per report). I already have the necessary parameter needed for the report(Pm-Supplier) so how can I run an oracle query on the fly per report page?
Eric
Query 1:
select vendor,supplierloc,commodity,ip from (select c.Vendor, q.supplierloc, c.commodity,SUM (q.indexpoints+q.lateindexpoints) AS ip
FROM qa_occ q, glovia_prod.c_vencom@GL7TEST c
where q.occdate BETWEEN TO_DATE ('4/1/2006', 'mm/dd/yyyy')
AND TO_DATE ('3/9/2007', 'mm/dd/yyyy')
and c.vendor=q.supplier
and (upper(trim(foundby)) not like '%MARKET%' or foundby is null)
and (upper(trim(foundby)) not like '%TRIAL%' or foundby is null)
and (upper(trim(rank)) not like '%MARKET%' or rank is null)
and (upper(trim(rank)) not like '%TRIAL%' or rank is null)
and nvl(void,'N') = 'N'
and q.supplier= @SUPPLIER
GROUP BY C.vendor,q.supplierloc,c.commodity) qa
union
select '' as vendor,supplierloc,commodity,ip from (select c.Vendor, q.supplierloc, c.commodity,SUM (q.indexpoints+q.lateindexpoints) AS ip
FROM qa_occ q, glovia_prod.c_vencom@GL7TEST c
where q.occdate BETWEEN TO_DATE (@BegDate, 'mm/dd/yyyy')
AND TO_DATE (@EndDate, 'mm/dd/yyyy')
and c.vendor=q.supplier
and (upper(trim(foundby)) not like '%MARKET%' or foundby is null)
and (upper(trim(foundby)) not like '%TRIAL%' or foundby is null)
and (upper(trim(rank)) not like '%MARKET%' or rank is null)
and (upper(trim(rank)) not like '%TRIAL%' or rank is null)
and nvl(void,'N') = 'N'
and q.supplier<> @SUPPLIER
GROUP BY C.vendor,q.supplierloc,c.commodity) qa
order by commodity,ip desc
Query 2:
select c.name as name,c.vendor,c.ven_loc, SUM(q.indexpoints+q.lateindexpoints) as ip
from qa_occ q,glovia_prod.ven_loc c
WHERE q.occdate BETWEEN TO_DATE (@BegDate, 'mm/dd/yyyy')
AND TO_DATE (@EndDate, 'mm/dd/yyyy')
and (upper(trim(q.foundby)) not like '%MARKET%' or q.foundby is null)
and (upper(trim(q.foundby)) not like '%TRIAL%' or q.foundby is null)
and (upper(trim(q.rank)) not like '%MARKET%' or q.rank is null)
and (upper(trim(q.rank)) not like '%TRIAL%' or q.rank is null)
and q.supplier is not null
and nvl(q.void,'N') = 'N'
and q.supplier=@SUPPLIER
and q.supplier=c.vendor
and q.supplierloc=c.ven_loc
GROUP BY c.name,c.vendor,c.ven_loc
union
select '' as name,c.vendor,c.ven_loc, SUM(q.indexpoints+q.lateindexpoints) as ip
from qa_occ q,glovia_prod.ven_loc c
WHERE q.occdate BETWEEN TO_DATE (@BegDate, 'mm/dd/yyyy')
AND TO_DATE (@EndDate, 'mm/dd/yyyy')
and (upper(trim(q.foundby)) not like '%MARKET%' or q.foundby is null)
and (upper(trim(q.foundby)) not like '%TRIAL%' or q.foundby is null)
and (upper(trim(q.rank)) not like '%MARKET%' or q.rank is null)
and (upper(trim(q.rank)) not like '%TRIAL%' or q.rank is null)
--and q.supplier is not null
and nvl(q.void,'N') = 'N'
and q.supplier=c.vendor
and q.supplierloc=c.ven_loc
and q.supplier <> @SUPPLIER
GROUP BY c.name,c.vendor,c.ven_loc
ORDER BY ip DESCYou can't, CR considers each subreport as a separate report and therefore it makes a new connection and runs the SQL for the subreport.
-
How to show all the search result in a report page
I have a report page which the user can enter first or last name to find the matched employees. The current report only show maximum of 15 matched results. How to show all of them in one page if more than 15.
Also, the employee name on the report is a link, how to make the link to be conditional. ( I mean it can be a link or not based on another column)
Thanks.
JenHi, you can change the number of rows on the report definition page (15 is the default value)- that's also where you can change pagination and max. number of rows etc.
About the second question - you will have to use Case or Decode in your report query and have the value as link or not based on the condition column, something like:
Select Decode(condition_column, 'link_value', '<a href="f?p=YOUR_APP:PAGE_TO_LINK_TO:' || :SESSION || ':::::">display_column</a>' , display_column) From .....
Hope this helps. -
Limit values shown in Parameter based on current week
We have a requirement wherein a parameter can be chosen depending on the current week number.
For example, today is Feb 3, 2015 (WEEK NUMBER 6), the parameter dropdown should only show
Week 1
Week 2
Week 3
Week 4
Week 5
Upon choosing a specific week, i.e. Week 2, SSRS report will show data where Created By matches the dates in Week 2 which is from January 4, 2015 to January 10, 2015 (SUNDAY is the first day week)
----------------------- Sharepoint NewbieHi 120613,
Because you are using the sharepoint list as the datasource and have some limitation when using query in the dataset, so I recommend you to take reference of the alternative method below which will not effect the filter of the data, you can create an calculated
field which will use to create the week parameter, the values of the Week list are before the week number of the today's date and get based on the date field in the report.
Details information below for your reference:
Create an new dataset(DataSet2) to add the query which have the same structure as in the main dataset but only contain the field "Date".
Right click the DataSet2 to select the "Add Calculated field" and create an new calculatted fields: name : "Week" and using expression below to get the value(The value will be the week number before the current date's week
number):
=IIF(DatePart("ww",Fields!date.Value)<DatePart("ww",Today()),DatePart("ww",Fields!date.Value),Nothing)
Create the parameter week based on the Calculated field "Week", specify both the Available value and default value by "Get Values from a query"
Add the filter in the Dataset as below:
Expression:=DatePart("ww",Fields!Date.Value)
Operator:In
Value: [@Week]
Preview you will got the result as below:
If the parameter is Multiple and you got some duplicate values, please reference to the article
Visakh16 have provided.
If you still have any questions, please feel free to ask.
Regards
Vicky Liu
If you have any feedback on our support, please click
here.
Vicky Liu
TechNet Community Support -
Add a Print button to a Report Page
I'm trying to add a Print button to a report page to render the page in printer-friendly mode and then give the user the option to send to a printer. I started with just trying to add a print button. I added a button to the region and added to the button request value javascript:window.print();. When I click on the print button, nothing happens. So I tried to add some html code:
<form>
<input type="BUTTON" value="Print" onClick="window.print()">
<form>
as a condition in Expression 1 when I selected "Current page is NOT in Printer Friendly mode". Nothing happens when I click on the print button. Can anyone offer some steps to create this functionality or point me to documentation on how to do this? I have tried the help documentation within APEX and isn't clear to me.
ThanksThe documentation wasn't very clear to me. I did try one suggestion to create a region on the report page and call it Print. The suggestion is then to add the following code to the Source Region section:
<form>
<input type='BUTTON' value="Print this page" onClick="window.print()">
<form>
The example however leaves out some significant information however. What is the region created as e.g. HTML, Report, Form, URL, etc? -
How to get date range of Current week
Hi Gurus,
I need to create report of current(this) week manual bills created by one user. I have date Field called CREAT_DATE.Based on this date column i need to create report.
Could anybody help to get this query.
Example:
select .....
from ....
where
CREAT_DATE
Thank You
VikramIt kind of depends on your definition of "current week". If you mean something like the last 7 days, then
SELECT columns
FROM table
WHERE creat_date BETWEEN TRUNC(sysdate - 7) and TRUNC(sysdate +1)would do it.
If you mean Monday until today, then:
SELECT columns
FROM table
WHERE creat_date BETWEEN NEXT_DAY(TRUNC(sysdate - 7), 'MONDAY') and TRUNC(sysdate +1)Read up on the various date functions for other possibilities.
TTFN
John -
Current date, first day of month, last day of month, current week, current
Hi All,
may be the question will sounds basic for your guys, I am connecting via MDX a cognos reportnet on a BW 3.0B..due to loads of limitations on filtering via MDX on 'business date/time functions' , I would need to create in the infoqueries that are my data sources, the following additionnal objects:
- current date
- first day of current month
- last day of current month
- current week
- current year
I do not want prefiltered infoqueiries but object with these single values so that from reportnet I can have something like: OCALDAY between 'first day of current month' and 'last day of curent month'
Is there standard fonction for this under BW/BEX or if we need to developp functions has nayone some code examples.
thanks a lot for your great input
DavidHi,
In universe level if you want implement the requirede functions then you have to write custom sql and if you want to implement them in Reporting level then most of the functions are available to you. e.g. Quarter,Month, Year, Current Date....
Cheers,
Suresh A. -
Hi there,
I want do get the number of the current week into a integer.
my code:
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.util.*"%>
Calendar calendar = Calendar.getInstance();
int kw = calendar.WEEK_OF_YEAR;
session.setAttribute( "show_kw", kw);
session.setAttribute( "kw", kw); // please do not wonder...I need this, tooLater in my code I want to display this number:
<p><%
session.getAttribute("show_kw");
%></p>But it displays...nothing. Not even a space.
Any idea, why it isn't showing up the number?
X--spYro--XYou need to use the following :
int kw = calendar.get(Calendar.WEEK_OF_YEAR);instead of
int kw = calendar.WEEK_OF_YEAR;in your code.
Hope this helps.
Thanks -
Bug Report: Page # and Icon Lost After Rename
I love the new file management features in version 10.3 but I noticed some problems right away.
After renaming a document, the current page position is lost and the document opens at page 1. This first one I renamed was a 400-page book and this was a bit annoying. I realize this is consistent with the desktop version which does not save the page position, but it is inconsistent with the iPad behavior for opening and closing documents. A fix or a warning should be implemented.
Also lost is the document icon, which reverts to a generic Reader logo. This is more of a cosmetic thing. I noticed the icon does not get restored after opening the document. It seems necessary to scroll down to page 2 for the icon to refresh.Here is the bug report page:
https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform -
Hello Experts,
I have a day name column and 3 measures query count, row count... and the requirement i have is, i need to get the data about the current week it means when i run the report now i should get only Monday of this week and its row count, query count.. and when i run it tomorrow i should get Monday, Tuesday and when i run it on wednesday Monday, tuesday, Wednesday and so on. Please let me know if i am not clear with my presentation. I am wondering how i can achieve this.
Thanks,
RCThanks for your response. I tried your code in the date column filter but its not working, i am getting error not sure if i can just take it and use the same code in the filter criteria. To be more clear i have Day name(Monday, Tuesday..), Day number(for sunday its 1,Monday 2,tuesday 3..) and Date (in the format 11/6/2011...) and the rest are measures,. Basically this is a system generated report like stats report. My requirement is i need to get the current week data as i mentioned earlier if i run the report today it should give me the information only from sunday to today. Please let me know how i can achieve this.
Thanks,
RC
Edited by: user1146711 on Nov 8, 2011 8:55 AM -
Current week Highlighted in Colour
Hello Gurus,
I have one report in which we are showing data for current week alongwith the previous four weeks data.User wants the current week to be highlighted with the colur. Is it possible in Bex?.My colmns contains calweeks and in rows I have Keyfigures.
Please add your suggestions.Hi Deepak,
You can create exception with refernce to the calweek characteristics.
Or in BW 7.0 we have highlight option available for the keyfigure under the display tab in properties.
Hope it helps.
Regards,
Umesh.
Maybe you are looking for
-
When I use Grab on my iMac (OSX 10.6.8) the picture put on my desktop is in ".tiff"! How do I covert it instead to .jpg - (for sending as email attachments?) PLEASE?
-
Import 24p Panasonic AJ-SPX800P
Is there a certain set up that should be used for files imported (P2) from this camera that are shot 24p? Every 5th frame, a frame is added, which looks horrible on any type of moving shots.
-
Hi all, What are the settings in SRM and ECC which determine whether GR reversal can be done even though the invoice is posted?Can some one explain w r t transaction codes/SPRO config path? Thanks.
-
Can I configure Safari to open full screen when first opening?
-
Macbook pro retina display has pinkish tint?
I have bought a macbook pro 15.4" with retina display.Everything is good but the screen.When I had a white wallpaper , then I saw the pinkish tint on the left and the normal white on the right, specially in the evening or in low light.How can I fix