Resource Work Variances
Work variance is the difference between the estimated work (the baseline) and actual work performed.
Handling Variances
The WorkVariance property exposed by the Resource class handles variance in work:
- WorkVariance: a project resource’s difference from the baseline work (double).
Microsoft Project View of Resource Work Variance
To see the resource work variance in Microsoft Project:
- On the Resource Sheet, go to the Insert menu and select Column.
- Add the Variance column.
Getting Resource Work Variance in Aspose.Tasks
The following code example demonstrated how to get resource work variance using Aspose.Tasks.
1// Read the input Project file
2System::SharedPtr<Project> project = System::MakeObject<Project>(dataDir + u"WorkVariance.mpp");
3Key<System::SharedPtr<Resource>, AsnKey> asnRsc = Asn::Resource();
4
5{
6 auto ra_enumerator = (project->get_ResourceAssignments())->GetEnumerator();
7 decltype(ra_enumerator->get_Current()) ra;
8 while (ra_enumerator->MoveNext() && (ra = ra_enumerator->get_Current(), true))
9 {
10 System::SharedPtr<Resource> rsc;
11
12 // C# preprocessor directive: #if !__cplusplus
13
14
15 // C# preprocessor directive: #endif
16
17 rsc = ra->Get(asnRsc);
18
19 double d = rsc->Get<double>(Rsc::WorkVariance());
20
21 System::Console::WriteLine(d);
22 }
23}