private void CompareRegionalAgainstNational(GroupRoot groupRoot, IndicatorMetadata metadata) { if (comparer != null && groupRoot.Grouping.Count > 1 && CanCompareSubnationalAgainstNational(groupRoot.FirstGrouping.ComparatorMethodId)) { Grouping regionalGrouping = groupRoot.GetSubnationalGrouping(); Grouping nationalGrouping = groupRoot.GetNationalGrouping(); if (nationalGrouping != null && regionalGrouping != null && regionalGrouping.ComparatorData != null) { Significance significance = comparer.Compare(regionalGrouping.ComparatorData, nationalGrouping.ComparatorData, metadata); regionalGrouping.ComparatorData.AddSignificance(nationalGrouping.ComparatorId, significance); } } }
private Significance GetSignificanceOnly(GroupRoot groupRoot) { Grouping grouping = groupRoot.GetNationalGrouping(); Significance significance; GetCoreDataSet(grouping, out significance); return significance; }
private static Grouping GetGrouping(IArea parentArea, GroupRoot groupRoot) { Grouping grouping = parentArea.IsCountry ? groupRoot.GetNationalGrouping() : groupRoot.GetSubnationalGrouping(); if (grouping == null) { throw new FingertipsException( "Cannot find both national and subnational groupings for indicator ID " + groupRoot.IndicatorId + ". You may need to change the comparator for this indicator in FPM."); } return grouping; }