Difference between revisions of "Diagram 2"
Line 5: | Line 5: | ||
==== The following steps show you how to create the above diagram ==== | ==== The following steps show you how to create the above diagram ==== | ||
− | <u>'''Step 1. Create a new axis set in DCS list based on the EndDate column'''</u><br> '''1. Open the Data Cache in Data Cache list''' (Tools/Data/Data Caches).<br>''' 2. In the Data Cache tab''' <br> '''2.1 Select Column’s type then click “Add Column” button to insert a new Custom column'''<br>[[Image:Add custom.JPG]] | + | <u>'''Step 1. Create a new axis set in DCS list based on the EndDate column'''</u><br> '''1. Open the Data Cache in Data Cache list''' (Tools/Data/Data Caches).<br>''' 2. In the Data Cache tab''' <br> '''2.1 Select Column’s type then click “Add Column” button to insert a new Custom column'''<br>[[Image:Add custom.JPG]] |
− | - A new Custom column is used to define the Quarter which this record is related to the current day in the system.<br>- Data type : Number <br>- Save numbers : 0,1 and null.<br> 0 : if the year of the EndDate column is the same with the current year in the system.<br> 1 : if the year of the EndDate column is in the previous year of current year in the system.<br> Null : if the year of the EndDate column is in other years. | + | - A new Custom column is used to define the Quarter which this record is related to the current day in the system.<br>- Data type : Number <br>- Save numbers : 0,1 and null.<br> 0 : if the year of the EndDate column is the same with the current year in the system.<br> 1 : if the year of the EndDate column is in the previous year of current year in the system.<br> Null : if the year of the EndDate column is in other years. |
− | '''2.2 Put the CGScript which defines Current Year and Last Year'''<br><span id="fck_dom_range_temp_1251961601465_789">[[Image: | + | '''2.2 Put the CGScript which defines Current Year and Last Year'''<br><span id="fck_dom_range_temp_1251961601465_789">[[Image:Insert script.JPG|693x230px]]</span> |
+ | |||
+ | - Input Name of the Custom column, this name will be an option of the axis set.<br>- Insert the CGSript.<br>// CGScript<br>array a = stringSplit(EndDate, " ");<br>string s = a[0];<br>a = stringSplit(s, "/");<br>number endDateYear = convertToNumber(a[2]);<br>number endDateMonth = convertToNumber(a[0]);<br>number endDateDay = convertToNumber(a[1]);<br>array today = getDateTime();<br>number todayYear = today[DateTime_Year];<br>number todayMonth = today[DateTime_Month];<br>number IsLastYear = 1;<br>number IsThisYear = 0;<br>if (endDateYear == todayYear)<br>return IsThisYear;<br>if (endDateYear == todayYear-1)<br>return IsLastYear;<br>//End Script | ||
+ | |||
+ | <br> '''3. Go to the Axis set tab: Create a new axis set''' <br> '''3.1 Create a new axis set<br>''' | ||
+ | |||
+ | '''[[Image:Create_new_axis.JPG|717x477px]]''' |
Revision as of 08:09, 3 September 2009
The diagram above is a cross diagram which is made by crossing 2 axes together:
- The X-axis has 12 options: Jan, Feb, Mar, … Dec
- The Y- axis has 2 options: This Year and Last Year. Calculations for these options are based on values stored in a custom column in the data cache. These values, which are calculated on corresponding values in the EndDate column, indicate whether an RPQ was finished in this year or last year.
The following steps show you how to create the above diagram
Step 1. Create a new axis set in DCS list based on the EndDate column
1. Open the Data Cache in Data Cache list (Tools/Data/Data Caches).
2. In the Data Cache tab
2.1 Select Column’s type then click “Add Column” button to insert a new Custom column
- A new Custom column is used to define the Quarter which this record is related to the current day in the system.
- Data type : Number
- Save numbers : 0,1 and null.
0 : if the year of the EndDate column is the same with the current year in the system.
1 : if the year of the EndDate column is in the previous year of current year in the system.
Null : if the year of the EndDate column is in other years.
2.2 Put the CGScript which defines Current Year and Last Year
- Input Name of the Custom column, this name will be an option of the axis set.
- Insert the CGSript.
// CGScript
array a = stringSplit(EndDate, " ");
string s = a[0];
a = stringSplit(s, "/");
number endDateYear = convertToNumber(a[2]);
number endDateMonth = convertToNumber(a[0]);
number endDateDay = convertToNumber(a[1]);
array today = getDateTime();
number todayYear = today[DateTime_Year];
number todayMonth = today[DateTime_Month];
number IsLastYear = 1;
number IsThisYear = 0;
if (endDateYear == todayYear)
return IsThisYear;
if (endDateYear == todayYear-1)
return IsLastYear;
//End Script
3. Go to the Axis set tab: Create a new axis set
3.1 Create a new axis set