Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Change the X-axis values based on the filter
Go
New
Search
Notify
Tools
Reply
  
[CLOSED] Change the X-axis values based on the filter
 Login/Join
 
Silver Member
posted
Hi Everyone,

I am trying to create a bar chart where y-axis is an amount and x-axis is a date(ex:01/14/2019). My plan is to create a conditional x-axis which works like this.When I select a date range that is more than 3 months x-axis should plot amount by "date" but show alternate(Sunday to Sunday)weeks as labels(Ex:Sun Jan 13, Sun Jan 27 etc).When I select date range that is more than a year x-axis should plot amount by "bi-weekly" intervals on graph but show "Months" as labels(Ex: Jan '19). Please provide if you have any inputs on how to create this in webfocus. Thank you very much.

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


Webfocus 8105/8202
Windows
All Outputs
 
Posts: 43 | Registered: June 26, 2018Reply With QuoteReport This Post
Virtuoso
posted Hide Post
If you don't already have these period defined (Sun Jan 13, Sun Jan 20, …) within a Date (calendar) table from which you can read from, you need to create them as you will do with any other programming language.
With WF you will use DEFINES or COMPUTE.
Assign a DEFINEd/COMPUTEd period for each available date.

Ideally, you should build a Date table where for each date you will assign its week value and any other period you need.
Then join this Date table to your data to have each data row linked with its proper Date table record. This way you will have access to your period fields.
Also it will become available to any other report since it's going to be a data table (Date table) and not specific to a report (hard coded).


WF versions : Prod 8.2.0.1M gen 240, Dev 8.2.04 gen 48, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2127 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Reply With QuoteReport This Post
Silver Member
posted Hide Post
Hi Martin,

Thanks for your input. Let's say I have these available at the data source and I have created a bar chart with amount in Y-axis and Date in X-axis. Can you let me know how to change the labels on x-axis based on the selected time range like I mentioned above.


quote:
Originally posted by MartinY:
If you don't already have these period defined (Sun Jan 13, Sun Jan 20, …) within a Date (calendar) table from which you can read from, you need to create them as you will do with any other programming language.
With WF you will use DEFINES or COMPUTE.
Assign a DEFINEd/COMPUTEd period for each available date.

Ideally, you should build a Date table where for each date you will assign its week value and any other period you need.
Then join this Date table to your data to have each data row linked with its proper Date table record. This way you will have access to your period fields.
Also it will become available to any other report since it's going to be a data table (Date table) and not specific to a report (hard coded).


Webfocus 8105/8202
Windows
All Outputs
 
Posts: 43 | Registered: June 26, 2018Reply With QuoteReport This Post
Virtuoso
posted Hide Post
You can do something such as this where &BY1 will be assigned to proper desired x-axis field
But it's also possible that you will need a "fake" field to have them order properly such as a real date and not a text field. Otherwise it will be ordered alphabatically
-SET &BY1 = DECODE &SELECTION ('BYWEEK'  DATEWEEK
-                              'BYMONTH' DATEMONTH
-                              ELSE      DATEDAY);
GRAPH FILE xyz
SUM VALUE
BY &BY1
END
-RUN


WF versions : Prod 8.2.0.1M gen 240, Dev 8.2.04 gen 48, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2127 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Reply With QuoteReport This Post
Silver Member
posted Hide Post
Hi Martin,

I will try this way. Thank you very much.

Regards
BI DEV


Webfocus 8105/8202
Windows
All Outputs
 
Posts: 43 | Registered: June 26, 2018Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Change the X-axis values based on the filter

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.