Historic data collection on Resource Data

From Catglobe Wiki
Revision as of 05:02, 18 October 2013 by Wikicatglobe (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

<accesscontrol>Main:MyGroup</accesscontrol> Every once in a while you not only need to have some data extracted from the state of the system, you also want to collect the historic data over time.

An example could be outstanding issues, like the below graph shows.

ExampleHistoricData.png

How to

First thing is to create the RCS on the data you actually need to view. Lets call it "Current Outstanding Issues".

Next thing to do is make a Tabulation script. This script should be setup to run with the "Current Outstanding Issues" data cache.

//Make sure that the DCS is up to date
DCS_rebuild();

//Calculate whatever numbers we need
number all_t1 = sum(Property_150) where (Completed);
number all_t2 = sum(Property_150) where (!Completed && Parameter_42 > 88);
number all_t3 = sum(Property_120) where (!Completed);
number all_Total = sum(Property_150) where (true);
number all_pct_done = 1 - (all_t1 + all_t3)/all_Total;
number all_pct_if_all_done_now = 1 - (all_t1 + all_t2)/all_Total;

//Go into RPQ context
setRPQId(1);
//Replace this with the id of the questionnaire you create below
number pqID = 719;
//Create a new Answer Sheet
number rpqId = createResourceProjectQuestionnaire(pqID);
//And make that the current one
setRPQId(rpqId);

//Store the data in the questionnaire
q_all_Total = all_Total;
q_all_pct_done = all_pct_done;
q_all_pct_if_all_done_now = all_pct_if_all_done_now;

setRPQCompleted(true);

This will read all the current data, calculate some number we are interested in keeping. All we need to do is create a questionnaire that will hold these data.

This we accomplish using QSL. With the very simple script below we can easily create a questionnaire to contain all the data we need.

QUESTIONNAIRE
QUESTION q_all_Total NUMBER [DUMMY=true;]
QUESTION q_all_pct_done NUMBER [DUMMY=true;]
QUESTION q_all_pct_if_all_done_now NUMBER [DUMMY=true;]

Then edit the tabulation script again, with the ID of the questionnaire, and setup a schedule to run it. This schedule should match the time periods you want to sample your data in.

Then create another data cache which just includes all questions from the questionnaire, and you will have a data cache containing the historic data from the reports of a what is otherwise a temporary view of the resources.