Focal Point
[SOLVED] Chart: Date range by "week"

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3957031886

October 24, 2017, 09:57 PM
BSBAL18
[SOLVED] Chart: Date range by "week"
In my chart, i see my REPORT_DATE (date field) automatically parsed for Y, Y-Q, Y-M, and Y-M-D. Is there any "by week" option somewhere? or would i Need to include a week reference in my actual data in another column?

This message has been edited. Last edited by: FP Mod Chuck,


AS Version: 8201
Gen: 10202016
Windows, All Outputs
October 25, 2017, 08:35 AM
BabakNYC
You can add week to your synonym. Open the synonym in the editor and insert a new field that extracts what you want. There are two Week formats:

  
ORDERDATE_weekday/W =DTPART(ORDERDATE, WEEKDAY);
ORDERDATE_weeknum/I9 =DTPART(ORDERDATE, WEEK);



WebFOCUS 8206, Unix, Windows
October 25, 2017, 09:35 AM
BSBAL18
I am able to make the WEEK i9, however how can I add in the year to that? When i use the | it says numeric where alpha is required.

DTPART(REPORT_DATE,YEAR) | DTPART(REPORT_DATE,WEEK)


AS Version: 8201
Gen: 10202016
Windows, All Outputs
October 25, 2017, 09:43 AM
BabakNYC
You can only concatenate alpha fields. So, first convert the Year and Week to Alpha and then use Pipe to concatenate them.


WebFOCUS 8206, Unix, Windows
October 25, 2017, 10:02 AM
MartinY
Or if both fields are numeric, you can do as following

YRWK /I6 = YEAR * 100 + WEEK;



WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007