Enhancement request: ISO week number

M language includes a function that returns the week number from a date: Date.WeekOfYear
However, it is much less flexible than the Excel 2010 Worksheet function WEEKNUM, which accepts a "return type" parameter. It can be used to return a ISO 8601 compliant week number. Ex: WEEKNUM(date,21).
It would be interesting to align the M function Date.WeekOfYear to the Excel WEEKNUM.
For those confronted to the challenge of building with Power Query a time dimension that includes an ISO week number, the following M code implements the formula found
in this blog. If you already have a column "Date", you can use the following code to add ISO year and week number columns:
InsertISOYear = Table.AddColumn(previousstepname, "ISOYear", each Date.Year(Date.AddDays([Date],3-Date.DayOfWeek([Date],1))), type number),
InsertRefDate = Table.AddColumn(InsertISOYear , "RefDate", each #date([ISOYear],1,3)),
InsertISOWeek = Table.AddColumn(InsertRefDate , "ISOWeek", each Number.IntegerDivide(Duration.Days( [Date]-[RefDate])+Date.DayOfWeek([RefDate],0)+6,7), type number ),
InsertWeekInt = Table.AddColumn(InsertISOWeek , "WeekInt", each [ISOYear] * 100 + [ISOWeek], type number),
InsertCalendarWeek = Table.AddColumn(InsertWeekInt , "WeekInCalendar", each Number.ToText([ISOYear]) & Number.ToText([ISOWeek],"-W00")),
RemovedColumns = Table.RemoveColumns(InsertCalendarWeek ,{"RefDate"})

I ran into the same issue, but had problems copying your solution. However, I think there is a quite simple alternative by using the Date.AddDays function. So instead of using e.g. Table.WeekOfYear([Date]) use Table.WeekOfYear(Date.AddDays([Date],-1)).
That substracts one day from the date and gives the Monday-Sunday weeknumber.

Similar Messages

  • How to format a date to display the ISO week number in BI Publisher ?

    Hi there,
    I need to format a date to display the ISO week number in BI Publisher.
    I've tried the following <?format-date:NEED_BY_DATE;'WW'?>, but it returns a week number (1-53) where week 1 starts on the first day of the year and continues to the seventh day of the year, which is not what I want.
    I want the ISO week number (1-52 or 1-53), the one implemented by the 'IW' format mask of the Oracle PL/SQL TO_CHAR() function for example.
    I've tried using 'IW' format mask, but it is not recognised by BI Publisher.
    Also, as I'm working on an RTF template, I've tried 'IW' as MS Word date format, but it is not recognised by MS Word :-((
    Any help would be much appreciated,
    Regards - Hugues

    Hi,
    Thank you for the post.
    The thing is I don't have access to the query, unless I modify a standard E-Businees Suite view (one of those used to generate the PO document in Purchasing).
    Regards - Hugues

  • Display ISO week number instead of date on x axis in Bar Chart

    Hi,
    I've created a simple SSRS report based on bar chart that shows several milestones. Everything works fine for me except I’m not able to convert the date into ISO week number format.
    I played around with different approaches. I was able to convert the date into an ISO week Format directly on the SQL Server. That
    wasn't a problem.
    But unfortunately I’m not able to display the week number on the horizontal axis in my Bar Chart. I tried both fields: TaskFinishDate and TaskFinishDateMS...
    I would like to show the ISO week number instead of the date within the Bar Chart on the horizontal axis.
    Any ideas/hints/help is really appreciated!
    Thanks,
    Mike

    Hi Mike,
    Per my understanding that you want to get the week number of the year based on the field "TaskFinishDate" which is datetime type and display the week number in the x-axis instead of the field "TaskFinishDate", right?
    I have check the snapshot you have provided and it seems you have change the format of the datetime field in the x-axis like "dd.MM.YYYY", If you can't make the week number to display correctly in the x-axis, the issue can be caused by you haven't
    change the format to Number in the category.
    Details information below for you reference:
    I assume you have use expression in the Label like below to convert the datatime TaskFinishDate in to ISO week number like below:
    =DatePart(DateInterval.WeekOfYear,Fields!TaskFinishDate.Value)
    or
    =DatePart("ww",Fields!TaskFinishDate.Value)
    Right click the X-axis and select the "Horizontal Axis Properties", then click the Number to change the format to "Number" as below:
    Preview you will get the weeknumber display in the x-axis correctly.
    If you still have any problem, please feel to ask.
    Regards,
    Vicky Liu
    If you have any feedback on our support, please click
    here.
    Vicky Liu
    TechNet Community Support

  • How to get ISO week number?

    hi,
    I need to interact with a server that expects to be passed the ISO week number. The Calendar class doesn't seem to support this though (although the documentation claims that it is ISO 8601 compliant).
    For instance the web page here gives today (Jan 10th 2005) as being in Week 2
    http://personal.ecu.edu/mccartyr/isowdcal.html
    but this code snippet returns "Week 3"
    import java.util.*;
    public class WeekOfYear {
         public static void main(String[]arg) {
              Calendar c = Calendar.getInstance();
              System.out.println("Week "+c.get(Calendar.WEEK_OF_YEAR));
    }does anyone know a correct way of getting the ISO 8601 Week number without reimplenting a lot of delicate code?
    thanks,
    asjf
    ps. of course for now, and the rest of 2005, i'm going to hard code subtracting 1 as a gratuitous hack :o)

    hi,
    thanks - i did check the docs :)
    the problem is that Calendar's idea of what the first week in the year is differs from the ISO standard
    the problem is that the ISO standard defines the first week of the year as that containing the first Thursday (ie some days may become part of the previous year's weeks)
    and Calendar defines it as the docs state - so to change the value returned would mean you having to change the "FirstDayOfWeek" or the "MinimalDaysInFirstWeek" - which (without checking recently) I think the ISO standard also defines so you can't safely change these
    I might raise a RFE against Calendar about this in a week or two since it seems quite important?
    thanks,
    asjf

  • OWB support for ISO Week number?

    Is there any way to get the Time dimension wizard to support the ISO standard for Year and Week numbering (formats IYYYY and IW)?
    I need to set up a time dimension for our data warehouse and our company uses the ISO Year/Week numbering schemes (see http://en.wikipedia.org/wiki/ISO_8601) if you don't know what these are.
    Failing that I can try to create my own but it looks like a tedious process calculating all of the durations, start and end-dates.
    Any guidance would be appreciated!

    hi,
    thanks - i did check the docs :)
    the problem is that Calendar's idea of what the first week in the year is differs from the ISO standard
    the problem is that the ISO standard defines the first week of the year as that containing the first Thursday (ie some days may become part of the previous year's weeks)
    and Calendar defines it as the docs state - so to change the value returned would mean you having to change the "FirstDayOfWeek" or the "MinimalDaysInFirstWeek" - which (without checking recently) I think the ISO standard also defines so you can't safely change these
    I might raise a RFE against Calendar about this in a week or two since it seems quite important?
    thanks,
    asjf

  • How to get the week start date from ISO week number

    Hi,
    I have a table with the following stucture
    Year    error    Week1     week2   week3 ......week53
    2012       error1     2           4         2             1
    2012       error2    3          0        1                 1I was hoping to get something like select year, error, week1||'Week start date which is a monday of that week' , week2||'Week start date,again monday',....week53 from table
    Any suggestions please?
    Thanks,
    Sun

    Hi, Sun,
    To see when week N started, add 7 * (N - 1) days to the beginning of the year. (By definition, the beginning of the ISO year is the start of week 1 of the ISO year.)
    To see when week 22 of the current year started:
    SELECT  TRUNC (SYSDATE, 'IYYY') + (7 * (22 - 1))
    FROM    dual
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say what version of Oracle you're using.
    See the forum FAQ {message:id=9360002}

  • Enhancement requests do seem to be worthwhile in the end...

    Having requested the continuous/shuffle music video playback several times in the last 18 months or so, and urged people to do so via...
    http://www.apple.com/feedback/appletv.html
    ...it has finally been implemented and I'm chuffed to bits.
    Well done Apple, this is a superb enhancement though why so long to implement ?
    Personally I feel this was a huge oversight for AppleTV ever since it was realeased, and seriously hindered both use of AppleTV as a media extender and obviated the point of buying music videos unless you watch them on portable devices which I don't.
    I had become increasingly negative about the prospect of ever seeing this feature
    appear - this cat doesn't wear a hat so I'll have to eat something else instead!
    I am now likely to spend a fair amount on music videos at iTunes Store having vowed not to do so again as having to select each one manually to play was tedious to say the least.
    Really baffles me how Apple have missed the opportunity for revenue from music video sales via AppleTV, particularly when iPods had the shuffle feature.
    As I commented a few weeks ago I think perhaps priorities since 2.0 update have been to get the store up and running properly before implementing enhancement requests or new features.
    Very pleased Apple have finally implemented this extremely useful feature, it may not be pointless in using the link above, it just takes time.
    So the next thing we should do is think of things to officially lobby for in future updates.
    My top 3 would be:
    1 - Allowing connection via USB to rescue data from AppleTV for users who've had hard drive accidents/msihaps and haven't backed up recently - fact of life it happens even if you're careful! Files with DRM are safe from unauthorised use and those without DRM are no less secure than they were before anyway. This could even be done by only allowing AppleTV to dump media to an external USB device instead of allowing an external connection to AppleTV itself, and could be controlled from say a backup menu option. Alternatively full manual bidirectional drag and drop of media via iTunes to/from AppleTV could be implemented with a mode to prevent a new sync library connection wiping existing content.
    What's in it for Apple? Huge boost in consumer confidence that Apple allow them to easily recover their personal files in the event of a problem - there should be no need to hack or dismantle AppleTV just to get at your data. Just think of all those people saying thank heaven I had an appleTV as my Macbook died and I'd forgotten to backup those wedding photos etc. We see examples of frustrated users almost daily with this problem.
    2 - Additional codec support - it's all very well saying h264 is the best thing since sliced bread and the current Apple/Apple Store standard, but the limited video codec support is probably the biggest hindrance to AppleTV becoming an extremely popular media device. It has the slickest interface of commercial products but many prospective customers have files in long established older formats that are incompatible without prior time consuming and quality degrading transcoding. Locking down AppleTV in this way alienates many potential users. The argument about the source of files in other formats may have some validity, but it is not Apple's job to infer that a user's file is of dubious origin simply for not being in h264 format. I am not condoning filesharing/torrents etc merely saying that most people have older files in older formats they want to use without conversion. Many DVD players allow playback of DivX (never use it myself), and if there's a licensing issue offer playback as a per device plugin option paid for by the user in the same way the QT MPEG2 pluging is offered.
    What's in it for Apple? Happy customers who would simply use something else like a PS3 to view their files and not buy AppleTV. New customers who would not have purchased otherwise. Happy customers who no longer need to trasncode files to watch. You'd be happy with being able to use older files, but would also get the benefit of using iTunes Store for new things.
    The overhwelming thing would be a sense of 'fair play' gained by the consumer. For me personally since 2.0+ the device's overwhelming iTunes Store based menu design sticks in the craw and has relegated MY content to the bottom of menus. Give us the best of both worlds - an iTunes Store top level section for purchases and separate simple top level sections for combined personal/purchased media as in software 1.0/1.1. In essence declutter the menu system for playback lumping all the purchasing/preview/search options together.
    3 - Tricky. Most useful would be an AppleTV SDK and 3rd party plugins/apps via iTunes paid and/or free similar to the iPhone model - I can live without widgets/visualisers/social networking plugins etc but they would be valuable to many users. As far as I know the iPhone Apps have been a huge success - no reason why not on AppleTV too, though commiting to this pathway would probably be very expensive in terms of developing a secure/sandboxed environment for running apps/plugins unless they could port the iPhone software fairly simply.
    Anyhow, once again delighted Apple have added the music video feature - I will start buying music videos from iTunes music store again. Bad for my wallet but good for Apple and AppleTV. Perhaps I should be thankful and consider how much I've saved not buying music videos in the last 18 months or so.....
    What would you like to see? Some things will be impossible/hardware limited, others quite feasible.
    Discuss, but also use the formal feedback link to give enhancements any chance to appear!
    Let's all help make AppleTV a success, and hopefully the media extender to beat!
    AC
    typos - Message was edited by: Alley_Cat

    Chenks wrote:
    to be honest, adding playlists (or whatever it is) for just music videos is of no use to me.
    it is playlists for tv shows that i need. ie the capability of playing episode 1 to 5 of a particular season back to back.
    Funny isn't it, how we all do things differently, have different preferences, enhancement wishes etc.
    For me it's not really a big chore to watch an episode then to manually start the next assuming I or Mrs AC are still awake!
    For episodes of short duration say 5-15 minutes I appreciate this could get annoying, and for longer episodes I suppose we are used to Play All type options on DVDs.
    If these are iTunes TV Shows you're stuck at the moment, but if they're say 'home recordings converted for AppleTV' you could theoretically get round it by setting their types to Music Video. Clumsy but it should work.
    I'm sure you can see the benefit of playlists/shuffling for music videos that may be 3-4 minutes each on average. I rediscovered dozens of iTunes Store music video purchases last night and thought 'yes, this is one of the big reasons why I bought AppleTV initially' - it did not say anywhere that AppleTV could not do this somewhat logical task - assumptions are dangerous though and invariably you only find out the full capabilities of products when using them.
    additional codec support ? i would say there is no chance of this. x264 is pretty standard theses days (if you discount the pirate industry). x264 is even used for HD TV in the UK.
    I agree, there's more chance of Tony Blair making a comeback!
    Piracy is rife and I do not support it.
    My views on fair use of media you personally own are quite different.
    It's not the codec/container that's the issue it's how the material was acquired in the first place - it may simply be your home videos, digitised off-air recordings etc that is in a 'legacy' format that you don't want to transcode. We know from the modders that most other SD formats are playable on the current hardware so that's not the issue.
    Take say an Elgato EyeTV device - I can record anything off-air, edit and transcode for AppleTV or just transcode unedited automatically. How much more sensible it woudl be if AppleTv simply supported the MPEG-2 transport stream playback rather than wasting time and computing/power resources doing the transcode.
    I have some some standard video-CDs I made on a PC in the late 1990's, how nice it would be to be able to play the MPEG-1 content back without fiddling - it's not as though converting to h264 will do anything for the quality!
    AC

  • Best method to determine the week number of a month - SQL Server 2012

    Hi,
    I'm searching the most valid and tested method to determine the week number respect to a month.
    Fe, the 1st January falls in the 1st week of January, the 1st February fall in the 1st week of February, and so on.
    I've found many solutions but I'd like to know possibly the best one.
    Thanks

    Hi Uri,
    SELECT DATEPART(week, '20150104')
         - DATEPART(week, CONVERT(CHAR(6), '20150104', 112)+'01')
         + 1
    returns 2 and not 1. It's a Sunday.
    Waiting to be spoonfed, eh?
    The one-off in my query would be very simple to figure out - I forgot to add the +1. Is too much to expect from you that you could figure it out yourself?
    And likewise, in my post I said that you should use "week" for weeks starting on Sunday, and "iso_week" if your week starts on Monday. Uri neglected to observe this, but you had the information to correct it. If you had been interested
    in doing some work yourself, that is.
    Nevertheless, there is an issue that I overlooked:
    DECLARE @day date = '20160105'
    SELECT datepart(iso_week, @day) -
           datepart(iso_week, convert(char(6), @day, 112) + '01') + 1
    This returns -51. This is because with ISO week numbering, Jan 1st falls into week 53 of the previous year, if it's on a Friday or later. Week 1 is always the week of Jan 4th. When you week this does not happen, as week 1 is always the week with Jan
    1st. (Dec 31st is always in week 53 or 54.)
    To correct for this, we need this query:
    SELECT DATEPART(iso_week, @day) -
           CASE WHEN DATEPART(iso_week, CONVERT(CHAR(6), @day, 112) + '01') < 50
                THEN DATEPART(iso_week, CONVERT(CHAR(6), @day, 112) + '01')
                ELSE 1
           END + 1
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Enhancement Requests for AWM10g

    Hi, before I start in on the enhancement requests I want to say that I am pretty impressed with AWM10g. Definitely a huge step forward in creating AWs. Having said that, I think there are a few enhancements that could be done to the tool to make it even more user friendl.
    Note that these are in no particular order, just ones I came up with while using the tool. I'll add any others that I come across.
    Please don't take this as nit-picking - just trying to help make it better.
    Thanks!
    Scott
    1. On dimension hierarchy types, instead of "value based" call it a "parent / child based" (thats what everyone knows it as)
    2. When creating levels, allow more than one level to be created at a time (currently it closes the dialog after each level is created, forcing you to go back and choose "create levels" over and over again). This may be as simple as having a "Save and create another" button or something.
    3. When typing names in the "system name" boxes, it would be nice if we could simply type the descriptions using spaces, and have the system name automatically replace with an underscore. Right now its a bit tedious to remember to type all names using underscores.
    4. In "mapping" view, move HELP, APPLY, and REVERT buttons off of bottom status bar and up to the top toolbar. There is lots of unused space at the top, creating a second bar at bottom just eats up screen real estate
    5. On "create dimension" dialog, no need for an entirely separate tab for "implmentation details" (that only has two values - generate unique keys or use the existing keys). Put this on the front tab so users don't have to keep selecting over to it (unless of course there are additional values that can show up there?)
    6. Mapping dimensions with multiple hierarchy - seems odd that we have to remap shared levels. Is it possible to make this where you would map all the values in the first hierarchy, and then only map the "missing" levels in the second hierarchy? Seems like an opportunity for hosing things up
    7. Drag and drop ordering when setting up the dimensions in a cube would be nice. Interface is the same as prior version of AWM (pretty clunky)
    8. Bug - when typing in any "name" field, if you highlight the entire field and delete all characters, under the "description" fields only a single character gets deleted.
    9. When there are multiple hierarchies for a given dimension, some sort of visual indicator of which one is set as default (without having to drill into details of each one)
    10. Its difficult (impossible?) to resize panes (for instance, when doing the mapping). Seems like sometimes I click on something by accident (other than the < and > arrows) that resizes the panes, and then I can't figure out how to get them back (other than exiting and restarting)
    11. When writing template out to same name as one that exists, AWM2 is not giving a "do you want to overwrite" prompt
    12. Some sort of clear visual indicator or message when a dimension is not completely "mapped". I had a dimension where I mistakenly forgot to map the leaf level dimension member. I didn't find out about it until I ran a load and the load blew up.
    13. On the XML logging at the end of a load process, the dialog box isn't big enough to show entire error messages if they occur. Since I haven't found a way to actually write the output to a txt file, this makes it hard to debug what is wrong with a solve.

    Anthony - thanks! In the meantime, I've come up with a few more requests / suggestions (and will probably have a few more yet to come...)
    Thanks again!
    Scott
    1) Rather than just showing the "working" bar while a load / solve is going on, would it be possible to replace this with some sort of functionality that queries against the OLAPSYS.xml_load_log table? And perhaps allow the user to click "refresh" or have it auto-refresh at a certain number of minutes so that users can actually see the progress being made?
    2) Since CATALOG view is no longer available, remove the options to have AWM write the log files

  • Enhancement request: Remote interface java file generation

    Problem:
    In release 9.0.3, If you want to write a method that is suppossed to be exposed in the remote interface, you have to first right click on the ejb-jar.xml's appropriate EJB name node and then add the method, specify the argument types (say about 25 in number in a small width textbox), return type, etc and check the check box 'Expose in remote interface'. Then only remote interface's java source gets updated and only after doing all this can you actually sit down to write the business logic in that method. If you first code the method and then try to add the same, it gives an error saying "duplicate method exists"
    Suggestion:
    The similiar feature in release 9.0.2 was much better and flexible as it allowed the generation of remote interface source after coding the actual method in the EJB source. You can first write the method and then expose it in the interface by just choosing it from a method browser and opting for exposing it in the remote interface. You donot have to write the name and number of arguments like we have to currently do in the 9.0.3 release.
    (1) Actually, all public methods in the EJB source should by default be exposed in the remote interface because EJB are supposed to be used by other EJBs and JSPs only and all methods that are public but not exposed in the remote interface should actually be private or protected.
    (2) Leave it up to the developer to edit the remote interface
    (3) When the EJB source file is changed (public methods changed) compiled the remote interface should also be updated automatically. Why? already you have provision to change the remote interface source, so just dump all the public methods in the remote interface source when the EJB source is compiled.
    (4) Ditto for EJB Homes
    (5) Actually whenever the developer changes and compiles the EJB source, the remote and home source should automatically be updated AND COMPILED. (Refer: Pramati Studio 3.0 SP3 :- URL: www.pramati.com )
    I was very happy with the earlier option. If anybody other then the JDeveloper Team finds this interesting, please respond. A suite like developer should be more User-friendly.
    And yes expect more like this from me in the future

    Hi Raghu,
    Thanks for the quick response. This flexiblity in Remote interface generation and choice of methods in it at any given point in the development cycle is very much desired feature.
    The other thing I would like to suggest is you look at another enhancement request in my name regarding batch updates of the "web.xml" file. You will find the thread updated today i.e. on 15th September with a reply
    I will shortly post one more for lack of modularity in EJB components descriptors.
    My Company Four Soft Pvt. Ltd. (www.four-soft.com) is Oracle's development partner and we use and support Oracle products. They are good but naturally we would like them to be better and more User-friendly.
    Thanks once again.
    Amit

  • Get week number for day from a list of days within a year..

    I am beginning in ORACLE / SQL and wondering how I can use this query to work with a column of Dates that span over a number of years?
    Ideally, I would like to use this script to add a number for the week of the year based on this.
    Then when a new year begins to start over..
    I am referencing an old thread..
    TO_CHAR with dates to get week number issue
    Here is what I have so far:
    I keep getting an error stating "Bind Variable "p_date_beg" is NOT DECLARED"..
    Thanks in advance for any help you can provide.
    DECLARE
    p_date_beg DATE;
    BEGIN
    SELECT RETRIEVAL_DATE
    INTO P_DATE_BEG
    FROM OBS_SELECT_LST12_SPG;
    WITH TAB AS
    (SELECT TO_DATE(TO_CHAR(:p_date_beg,'YYYYMM')||'01','YYYYMMDD') + LEVEL -1 DATE_COL
    FROM DUAL
    CONNECT BY LEVEL <=TO_NUMBER(TO_CHAR(LAST_DAY(:p_date_beg),'DD')))
    SELECT DATE_COL, TO_CHAR(DATE_COL, 'FMDAY') DAY,
    (CASE
    WHEN TO_CHAR(TRUNC(DATE_COL, 'mm'),'FMDAY') = 'SUNDAY'
    THEN TO_NUMBER(TO_CHAR(DATE_COL,'W'))
    ELSE CEIL((TO_CHAR(SYSDATE, 'dd') + 1 - TO_CHAR(NEXT_DAY(TRUNC(SYSDATE, 'mm'), 'SUNDAY'), 'dd'))/7)
    END) WEEK_NOB
    END;

    hi, referring to this link about ISO week, http://www.epochconverter.com/date-and-time/weeknumbers-by-year.php, here is the code:
    /* Formatted on 2012/06/13 06:32 (Formatter Plus v4.8.8) */
    WITH t AS
         (SELECT     MIN (TO_DATE ('20120101', 'rrrrmmdd') + LEVEL - 1)
                                                                       start_date,
                     1 week_th
                FROM DUAL
               WHERE TO_CHAR (  TRUNC (TO_DATE ('20120101', 'rrrrmmdd'), 'mm')
                              + LEVEL
                              - 1,
                              'FMDAY'
                             ) = 'MONDAY'
                 AND (   TO_DATE ('20120101', 'rrrrmmdd') + LEVEL - 1 <
                            TRUNC (NEXT_DAY (TO_DATE ('20120101', 'rrrrmmdd'),
                                             'THU'
                      OR (TO_DATE ('20120101', 'rrrrmmdd') + LEVEL - 1
                             BETWEEN TRUNC (NEXT_DAY (TO_DATE ('20120101',
                                                               'rrrrmmdd'
                                                      'THU'
                                 AND   TRUNC (NEXT_DAY (TO_DATE ('20120101',
                                                                 'rrrrmmdd'
                                                        'THU'
                                     + 7
          CONNECT BY LEVEL < 15),
         v AS
         (SELECT     t.start_date + 7 * (LEVEL - 1) start_date,
                     t.week_th + LEVEL - 1 week_th
                FROM t
          CONNECT BY LEVEL < 53),
         u AS
         (SELECT '20120501' dt
            FROM DUAL
          UNION ALL
          SELECT '20120502'
            FROM DUAL
          UNION ALL
          SELECT '20120503'
            FROM DUAL
          UNION ALL
          SELECT '20120504'
            FROM DUAL
          UNION ALL
          SELECT '20120505'
            FROM DUAL
          UNION ALL
          SELECT '20120506'
            FROM DUAL
          UNION ALL
          SELECT '20120507'
            FROM DUAL
          UNION ALL
          SELECT '20120508'
            FROM DUAL
          UNION ALL
          SELECT '20120509'
            FROM DUAL)
    SELECT *
      FROM u, v
    WHERE TO_DATE (u.dt, 'rrrrmmdd') BETWEEN v.start_date AND (v.start_date + 6);output:
    DT     START_DATE     WEEK_TH
    20120501     30/04/2012     18
    20120502     30/04/2012     18
    20120503     30/04/2012     18
    20120504     30/04/2012     18
    20120505     30/04/2012     18
    20120506     30/04/2012     18
    20120507     07/05/2012     19
    20120508     07/05/2012     19
    20120509     07/05/2012     19

  • OWB 10gR2 - some enhancement requests

    Hi, I've been working with OWB 10gR2 for approximately a week now, and I've come across a few (minor) bugs, as well as a list of enhancements that I think would make the tool better. I'd like to surface these in this forum so they can be either disagreed with or have workarounds suggested, as well as getting this list in front of Oracle. Also I'm new to the tool, so maybe there are ways to accomplish what I want.
    p.s. as a side note - please don't take these as criticisms of the tool. I'm actually very impressed with OWB 10gR2, but just want to surface some ideas that I think would make the tool better.
    Thanks,
    Scott
    ---Bugs:
    1.     If I enter a quote character in one of the business description fields (i.e. for a cube or dimension), it causes the DDL scripts to blow up. It probably mentions the list of valid characters in the users guide somewhere - but if a character isn't legal, it should be flagged when I try to enter it originally – not when deploying
    2.     I can enter illegal strings in an expression operator that fail validation there, but the whole map still passes validation. For instance, I put in an expression (for a varchar2 field) using a single quote at the start, but mistakenly with a double quote at the end. I didn’t bother to validate this within the expression. The whole map validated fine, but (of course) blew up with the illegal syntax when generating the code.
    3.     I get the following error when trying to browse a cube (ROLAP, not MOLAP) through OWB, but I'm able to pull the cube up fine using either the excel add-in or biBeans: CubeDV_OLAPSchemaConnectionException_ENT_06952???
    ---Enhancement Requests:
    1.     Add a “deploy” button in control center next to the to “default actions” and “reset actions” buttons
    2.     Allow an option to have dimensions and cube defaults set to either “deploy all”, “deploy data only”, “deploy catalog only”, “deploy aggregations” (for cubes). Also, why is the default set to “deploy data only”? Does deploying the CMW2 metadata involve huge performance impacts or something? It seems like the CMW2 is almost “free” – so it should be turned on by default. Its a pain to use the dimension wizard, but then have to go in to each dimension afterwards to set this option.
    3.     When using “configure” on dims and cubes in control center, the first time the “configuration properties” dialog pops up, everything is fine. However, when you try to configure the 2nd object, the “background focus” switches from control center back to design center. This makes navigation very slow if you have lots of items to change. I've noticed this behavior in a few other places as well.
    4.     Some dialogs do not have maximize buttons (i.e. dimension wizard dialogs), and default to a very small size. It is possible to have size of dialogs dynamically scaled to screen resolutions, and attempt to size columns so they fit properly. Or better yet, have each dialog remember how large it was last time, and automatically open up to that size?
    5.     When generating the “autobind” relational table while creating a dimension, it seems to be “randomizing” the order of the attributes within a level (although it does sort the “top level” attributes first, followed by lower level attributes), at least when using the dimension wizard. It would be nice if the attributes in the relational table came out sorted in the same order as they are specified in the attributes tab.
    6.     When using a “unmapped” display set– there doesn’t seem to be a way to refresh the set (i.e. remove the items that have since been mapped) unless you select “all” and then “unmapped” again. Would be nice if you could simply choose “unmapped” again and have it refresh the object
    7.     While doing a mapping, right click on canvas allows option to “generate”. Would be nice to also add the “validate” option to this menu
    8.     Validating mappings takes a decent amount of time – would be nice if a “busy” icon was displayed to let user know that OWB hasn’t locked up.
    9.     default size of “job details” dialog is too small, and even if I maximize I still have to go through and manually adjust the size of each pane. Similar to enhancement #4
    10.     Horizontal size of operators in mapping seems to be determined by the length of the operator name, instead of tying directly to the icon. Looks strange. Very minor
    11.     When displaying dimension objects in a mapping:
    a.     For the “surrogate key” columns – add an icon to indicate this attribute is a surrogate key. Likewise, since its not legal to map anything to this column, remove the little “arrow” next to it (the one that turns gray when something is mapped to a column), or perhaps don't even show this column at all.
    b.     For the “business key” columns – add some type of icon to show which attributes represent the business natural key (or make color different, etc.)
    12.     Similar to #11, for the cube operator in a mapping:
    a.     For the “surrogate key” columns – if they can’t be mapped to, then don’t show them
    b.     For the “business key” columns – add some type of icon to show which attributes represent the business natural key
    c.     Separate the “measure” columns from the dimension columns
    13.     For the “Aggregation” operator – can you move the “<None>” default operator to the top of the list. At the bottom, it means you always have to scroll to use the most common operations (which are at the top of the list), i.e. sum and avg, etc.
    14.     In the log on prompt, if I choose SQL*Net connection, every time I start it up it defaults to the details being shown (even when I chose no detail last time), with cursor in the “host” box. I should be able to have the details hidden, and this dialog should ALWAYS default to having the active cursor in the password box on startup
    15.     When printing in a mapping, the “page setup” print dialog is very slow. Also, the “print setup” dialog shows margins, but you can’t adjust them. It would be nice if this could be changed here
    16.     Add a “print preview” icon to all of the toolbars. Printer icon is there, print preview should also be.
    17.     In the dimension attributes, we need a way to tag an attribute as being the “insert record” date or the “update record” date. The corresponding MERGE SQL should be updated to use these attributes.
    18.     It would be nice if the mapping canvas defaulted to an unlimited size…i.e. when I want to add new operators and the screen is already full, I either need to shrink the zoom factor down to the point where I can’t read the icons anymore, or I have to pick up the new operator and “drag” at the bottom / right side until it scrolls enough to drop it where I want. If the canvas had an unlimited size, I could simple use the scroll bars to scroll to where I want.
    19.     Scroll wheel functionality to zoom in / out (and have it zoom in around the currently selected object)
    20.     Option to have operations automatically resize when longer attribute names are added to them (can workaround by mimimizing and then maximizing, but would be better to have the operators automatically adjust size to fit)
    21.     Ability to sort output attributes in an operator (just like table column sort functionality). If I create a new operator, it would be nice to group it with related operators instead of always having it at bottom.
    22.     re: column sort functionality – drag and drop instead of up/down arrows would be nice
    23.     It would be nice if, when adding output attributes to (for example) the expression operator, it would choose the default data type the same way the dimension attribute wizard works (i.e. if it sees “ind” in name, automatically choose char(1)
    24.     Change the “zoom in” button so that it zooms in on the currently selected operator – i.e. if I click on a particular table and then hit the zoom in button, it should keep the table I selected centered
    25.     When in a mapping, clicking on a line should highlight the attributes on both the source and target operators (to allow easier visual ID of where data is coming from / going to)
    26.     AWM has a feature where table attributes can be sorted so that mappings between them don't have "crossed" lines. Similar functionality in OWB would be very appreciated. It may be harder to automate this, but even manual drag and drop of attributes within an operator would be nice.

    if you could copy/paste this whole thing into the submission form (see feedback option under the numbers menu). The more people that request these features, the more likely we are to see them in an update or the next version.
    Jason

  • Enhancement Request - comments

    I've recently demonstrated the SQL Workshop within HTMLDB to a number of users of varying experience, and the response has been very positive indeed. However, a common complaint was that there is very little table and column specific (i.e. metadata) available through the object browser and the query builder. One way that this type of information might be held is through table and column comments (e.g. user_tab_comments and user_col_comments) however comments are not displayed in the object browser or query builder.
    Also, Although there's a table comment report in the utilities in the SQL Workshop, there is no easy (i.e. other than writing SQL) way of putting comments on tables, columns etc.
    Thus the main enhancement request is for comments on tables and columns displayed in the object browser and the query builder, and a follow up would be for the GUI to provide a method of maintaining that information.
    Alternatively, if a some links (i.e. on the table and individual columns) could be added to the object browser/query builder which linked to a customisable application (something akin to the security models), then metadata could be served through a custom built application. This would, IMHO, be the best approach - in fact the display of column and table comments could be the default, but allow an over-ride for a custom app.

    Simon,
    Thanks for this feedback. We will take it into consideration.
    Sergio

  • Enhancement request for more fine-grained templates

    JHeadstart version : 10.1.2.0
    I like to have the possibility to define templates on the level of table rows. If I am correct, currently the 'lowest' level of a .jtt template is the $FORM_ITEMS$ token. According to the userguide this token "is used to indicate the place where a form must be generated". My question is now: How can I influence this generation process? For example, I want to embed text-items within <c:if's in order to conditionally set a text-item attribute. Am I right to conclude that on this "deeper" level of a jsp (for instance table-row level), it is not possible to define templates?
    If so, I want to request an enhancement for a further 'fine-graining' of the templating technique.
    Thanks and greetings, Erik
    Message was edited by:
    ekerkhov

    Erik,
    Yes, this is not possible in he current release.
    Your enhancement request has already been implemented for the JDev10.1.3/Faces release. We will the support two kinds of tokens, one that outputs all items as it is today ($FORM_ITEMS$ or $TABLE_ITEMS$), and one token that refers to an individual item. This reference can be bpoth on index number and name:
    FORM_ITEM_1 or
    FORM_ITEM_DepartmentName
    This will allow you to layout the items exactly as you want.
    Note that in the 10.1.3 release, we will also support item-level templates where you can add code to conditonally render items.
    Steven Davelaar,
    JHeadstart Team.

  • Generating 52 weeks number of a year associated to a date

    hi
    I try to generate the 52 weeks number of a year associated to the date of the first monday of the week
    For example 1 (week number 1) would be associated to the first monday on the first week of the year.
    Week 2 associated to the secondth week of the year, adn so on. The result would be to columns :
    Number of the wee and its corresponding date of the monday :
    Number_of_the_week----DATE
    1----------------------------01/01/2008
    2----------------------------14/01/2008
    ...... etc....
    52---------------------------29/12/2008
    The request should be something including the year in a "select .(something)... from dual"
    Could you suggest me something ?
    Thank you for your kind answers !Christian

    Christian from France wrote:
    It is not so bad except that each date falls on the tuesday instead of the monday of the week. Hmmm, I don't remember you specifying that in your initial requirements.
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select 2009 as yr from dual)
      2      ,off as (select to_number(to_char(trunc(to_date(yr,'YYYY'),'YYYY'),'D'))-1 as offset from t)
      3  select rownum as week, trunc(to_date(t.yr,'YYYY'),'YYYY')+((rownum-1)*7)-decode(rownum,1,0,off.offset) as dt
      4  from t, off
      5* connect by rownum <= 53
    SQL> /
          WEEK DT
             1 01-JAN-09
             2 05-JAN-09
             3 12-JAN-09
             4 19-JAN-09
             5 26-JAN-09
             6 02-FEB-09
             7 09-FEB-09
             8 16-FEB-09
             9 23-FEB-09
            10 02-MAR-09
            11 09-MAR-09
            12 16-MAR-09
            13 23-MAR-09
            14 30-MAR-09
            15 06-APR-09
            16 13-APR-09
            17 20-APR-09
            18 27-APR-09
            19 04-MAY-09
            20 11-MAY-09
            21 18-MAY-09
            22 25-MAY-09
            23 01-JUN-09
            24 08-JUN-09
            25 15-JUN-09
            26 22-JUN-09
            27 29-JUN-09
            28 06-JUL-09
            29 13-JUL-09
            30 20-JUL-09
            31 27-JUL-09
            32 03-AUG-09
            33 10-AUG-09
            34 17-AUG-09
            35 24-AUG-09
            36 31-AUG-09
            37 07-SEP-09
            38 14-SEP-09
            39 21-SEP-09
            40 28-SEP-09
            41 05-OCT-09
            42 12-OCT-09
            43 19-OCT-09
            44 26-OCT-09
            45 02-NOV-09
            46 09-NOV-09
            47 16-NOV-09
            48 23-NOV-09
            49 30-NOV-09
            50 07-DEC-09
            51 14-DEC-09
            52 21-DEC-09
            53 28-DEC-09
    53 rows selected.
    SQL>

Maybe you are looking for

  • Cannot select multiple images in iPhoto '08?

    What am I doing wrong? I want to select multiple images to either print several on a page, or publish to a gallery, but for the life of me I cannot find a view which shows me all photo thumbnails or all thumbnails in an album or all in an event. I ca

  • Trunc 2 decimal places

    I have a report that has the option of dispalying pdf or excel. I have the pdf version working fine but i am having a little trouble on the excel version. I have a grand total and department total. Basically I need help formating two decimal places.

  • Info records pulling into purchase orders

    I have created an info record for a material group only (i.e. without material master as it is for a non-stock item).  It is my understanding that this creates a vendor-material group relationship.  When creating a purchase order for this unique comb

  • Crash in Flash Pro CS6

    Hi folks, I have a minute of video that I am trying to import as a PNG image sequence.  Crash.  Crash.  Crash.  If anyone has time to test ... Alright .. 5 minutes later .. import sequence to stage OK .. Save OK .. Now this is what happens when publi

  • IPhoto 9.1.1 ('11) messed up soft links

    I recently noticed that iPhoto is not following all of my aliases to find the original photos. I do not copy my photos to iPhoto, so when I import them, iPhoto creates an alias to the original file (which is on the same volume). It turns out that iPh