Difference between revisions of "Diagram 1"

From Catglobe Wiki
Jump to: navigation, search
Line 9: Line 9:
 
[[Image:Add custom.JPG]]  
 
[[Image:Add custom.JPG]]  
  
- The 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,4 and null.<br>&nbsp; 0: if the date of the EndDate column is in the same quarter of current date in the system.<br>&nbsp; 1: if the date of the EndDate column is in the previous quarter of current date in the system.<br>&nbsp; 4: if the date of the EndDate column is in the same quarter but in the last year of current date in the system.<br>&nbsp; Null: if the date of the EndDate column is in other quarters.<br>&nbsp;&nbsp; '''2.2 Put the CGScript which defines Current Quarter, Last Quarter and the Same Quarter Last Year'''
+
- The 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,4 and null.<br>&nbsp; 0: if the date of the EndDate column is in the same quarter of current date in the system.<br>&nbsp; 1: if the date of the EndDate column is in the previous quarter of current date in the system.<br>&nbsp; 4: if the date of the EndDate column is in the same quarter but in the last year of current date in the system.<br>&nbsp; Null: if the date of the EndDate column is in other quarters.<br>&nbsp;&nbsp; '''2.2 Put the CGScript which defines Current Quarter, Last Quarter and the Same Quarter Last Year'''  
  
[[Image:Insert script.JPG]]&nbsp;<span id="fck_dom_range_temp_1251959401561_579" /><span id="fck_dom_range_temp_1251959401561_111" /><span id="fck_dom_range_temp_1251959401576_487" /><span id="fck_dom_range_temp_1251959401576_982" /><span id="fck_dom_range_temp_1251959401576_506" /><span id="fck_dom_range_temp_1251959401576_587" />
+
[[Image:Insert script.JPG]]&nbsp;&lt;span id="fck_dom_range_temp_1251959401561_579" /&gt;&lt;span id="fck_dom_range_temp_1251959401561_111" /&gt;&lt;span id="fck_dom_range_temp_1251959401576_487" /&gt;&lt;span id="fck_dom_range_temp_1251959401576_982" /&gt;&lt;span id="fck_dom_range_temp_1251959401576_506" /&gt;&lt;span id="fck_dom_range_temp_1251959401576_587" /&gt;
  
- 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, " "); // get value of the EndDate column
+
- 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, " "); // get value of the EndDate column  
  
string s = a[0];
+
string s = a[0];  
  
a = stringSplit(s, "/"); // omit character “/”
+
a = stringSplit(s, "/"); // omit character “/”  
  
number endDateYear = convertToNumber(a[2]); // get the year of the date in the EndDate column
+
number endDateYear = convertToNumber(a[2]); // get the year of the date in the EndDate column  
  
number endDateMonth = convertToNumber(a[0]); // get the month of the date in the EndDate column
+
number endDateMonth = convertToNumber(a[0]); // get the month of the date in the EndDate column  
  
number endDateDay = convertToNumber(a[1]); // get the day of the date in the EndDate column
+
number endDateDay = convertToNumber(a[1]); // get the day of the date in the EndDate column  
  
 
array today = getDateTime(); // get the current date  
 
array today = getDateTime(); // get the current date  
  
number todayYear = today[DateTime_Year]; // get the year of the current date
+
number todayYear = today[DateTime_Year]; // get the year of the current date  
  
number todayMonth = today[DateTime_Month]; // get the month of the current date
+
number todayMonth = today[DateTime_Month]; // get the month of the current date  
  
number TodayQuarter = 1; // save the quarter which the current date related to
+
number TodayQuarter = 1; // save the quarter which the current date related to  
  
number endDateQuarter = 1; // save the quarter which the day in the EndDate column related to
+
number endDateQuarter = 1; // save the quarter which the day in the EndDate column related to  
  
 
number IsLastQuarter = 1;  
 
number IsLastQuarter = 1;  
  
number IsThisQuarter = 0;
+
number IsThisQuarter = 0;  
  
number IsSameQuarterLastYear = 4;
+
number IsSameQuarterLastYear = 4;  
  
if (todayMonth == 1 || todayMonth == 2 || todayMonth == 3)
+
if (todayMonth == 1 || todayMonth == 2 || todayMonth == 3)  
  
TodayQuarter = 1;
+
TodayQuarter = 1;  
  
else if (todayMonth == 4 || todayMonth == 5 || todayMonth == 6)
+
else if (todayMonth == 4 || todayMonth == 5 || todayMonth == 6)  
  
 
TodayQuarter = 2;  
 
TodayQuarter = 2;  
  
else if (todayMonth == 7 || todayMonth == 8 || todayMonth == 9)
+
else if (todayMonth == 7 || todayMonth == 8 || todayMonth == 9)  
  
TodayQuarter = 3;
+
TodayQuarter = 3;  
  
else TodayQuarter = 4;
+
else TodayQuarter = 4;  
  
if (endDateMonth == 1 || endDateMonth == 2 || endDateMonth == 3)
+
if (endDateMonth == 1 || endDateMonth == 2 || endDateMonth == 3)  
  
endDateQuarter = 1;
+
endDateQuarter = 1;  
  
else if (endDateMonth == 4 || endDateMonth == 5 || endDateMonth == 6)
+
else if (endDateMonth == 4 || endDateMonth == 5 || endDateMonth == 6)  
  
 
endDateQuarter = 2;  
 
endDateQuarter = 2;  
  
else if (endDateMonth == 7 || endDateMonth == 8 || endDateMonth == 9)
+
else if (endDateMonth == 7 || endDateMonth == 8 || endDateMonth == 9)  
  
endDateQuarter = 3;
+
endDateQuarter = 3;  
  
else endDateQuarter = 4;
+
else endDateQuarter = 4;  
  
if (endDateYear == todayYear &amp;&amp; endDateMonth == todayMonth)
+
if (endDateYear == todayYear &amp;&amp; endDateMonth == todayMonth)  
  
return IsThisQuarter;
+
return IsThisQuarter;  
  
else if (endDateYear == todayYear &amp;&amp; TodayQuarter - endDateQuarter == 1)
+
else if (endDateYear == todayYear &amp;&amp; TodayQuarter - endDateQuarter == 1)  
  
 
return IsLastQuarter;  
 
return IsLastQuarter;  
  
else if (todayYear - endDateYear == 1 &amp;&amp; endDateMonth == todayMonth)<br><br>return IsSameQuarterLastYear;<br>//End Script<br>&nbsp;'''3. Go to the Axis set tab: Create a new axis set&nbsp;'''<br>&nbsp;&nbsp; '''3.1 Create a new axis set''' [[Image:Create_new_axis.JPG]]
+
else if (todayYear - endDateYear == 1 &amp;&amp; endDateMonth == todayMonth)<br><br>return IsSameQuarterLastYear;<br>//End Script<br>&nbsp;'''3. Go to the Axis set tab: Create a new axis set&nbsp;'''<br>&nbsp;&nbsp; '''3.1 Create a new axis set''' [[Image:Create new axis.JPG]]
 +
 
 +
&nbsp;&nbsp; '''3.2 Input value to the new axis set'''
 +
 
 +
'''[[Image:Input_value.JPG]]'''
 +
 
 +
<span id="1251959714895S" style="display: none">&nbsp;</span>Axis math – base, Axis pct – base, Option value: will be used by the Custom column’s name.
 +
 
 +
For example:
 +
 
 +
[[Image:Example.JPG|787x400px]]

Revision as of 08:36, 3 September 2009

Diagram 1.JPG

The diagram above is a cross diagram which is made by crossing 2 axes together:
- The x-axis has 4 options: Custom Service, Product, Web site and Brand.
- The y-axis has 3 options: Same Quarter Last Year, Last Quarter and This Quarter. 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 quarter, last quarter, or the same quarter 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

Add custom.JPG

- The 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,4 and null.
  0: if the date of the EndDate column is in the same quarter of current date in the system.
  1: if the date of the EndDate column is in the previous quarter of current date in the system.
  4: if the date of the EndDate column is in the same quarter but in the last year of current date in the system.
  Null: if the date of the EndDate column is in other quarters.
   2.2 Put the CGScript which defines Current Quarter, Last Quarter and the Same Quarter Last Year

Insert script.JPG <span id="fck_dom_range_temp_1251959401561_579" /><span id="fck_dom_range_temp_1251959401561_111" /><span id="fck_dom_range_temp_1251959401576_487" /><span id="fck_dom_range_temp_1251959401576_982" /><span id="fck_dom_range_temp_1251959401576_506" /><span id="fck_dom_range_temp_1251959401576_587" />

- Input Name of the Custom column, this name will be an option of the axis set.
- Insert the CGSript.
// CGScript
array a = stringSplit(EndDate, " "); // get value of the EndDate column

string s = a[0];

a = stringSplit(s, "/"); // omit character “/”

number endDateYear = convertToNumber(a[2]); // get the year of the date in the EndDate column

number endDateMonth = convertToNumber(a[0]); // get the month of the date in the EndDate column

number endDateDay = convertToNumber(a[1]); // get the day of the date in the EndDate column

array today = getDateTime(); // get the current date

number todayYear = today[DateTime_Year]; // get the year of the current date

number todayMonth = today[DateTime_Month]; // get the month of the current date

number TodayQuarter = 1; // save the quarter which the current date related to

number endDateQuarter = 1; // save the quarter which the day in the EndDate column related to

number IsLastQuarter = 1;

number IsThisQuarter = 0;

number IsSameQuarterLastYear = 4;

if (todayMonth == 1 || todayMonth == 2 || todayMonth == 3)

TodayQuarter = 1;

else if (todayMonth == 4 || todayMonth == 5 || todayMonth == 6)

TodayQuarter = 2;

else if (todayMonth == 7 || todayMonth == 8 || todayMonth == 9)

TodayQuarter = 3;

else TodayQuarter = 4;

if (endDateMonth == 1 || endDateMonth == 2 || endDateMonth == 3)

endDateQuarter = 1;

else if (endDateMonth == 4 || endDateMonth == 5 || endDateMonth == 6)

endDateQuarter = 2;

else if (endDateMonth == 7 || endDateMonth == 8 || endDateMonth == 9)

endDateQuarter = 3;

else endDateQuarter = 4;

if (endDateYear == todayYear && endDateMonth == todayMonth)

return IsThisQuarter;

else if (endDateYear == todayYear && TodayQuarter - endDateQuarter == 1)

return IsLastQuarter;

else if (todayYear - endDateYear == 1 && endDateMonth == todayMonth)

return IsSameQuarterLastYear;
//End Script
 3. Go to the Axis set tab: Create a new axis set 
   3.1 Create a new axis set Create new axis.JPG

   3.2 Input value to the new axis set

Input value.JPG

Axis math – base, Axis pct – base, Option value: will be used by the Custom column’s name.

For example:

Example.JPG