/// <summary> /// Initializes a new instance of the <see cref="AnalysisTable"/> class. /// </summary> /// <param name="analysis">Analysis</param> /// <param name="configTable">Config table</param> /// <param name="queryTableIndex">Query table index</param> public AnalysisTable(Analysis analysis, UPConfigAnalysisTable configTable, int queryTableIndex) { this.ConfigTable = configTable; this.Analysis = analysis; this.Key = configTable.Key; this.QueryTableIndex = queryTableIndex; this.fieldArray = new List <object>(); this.fieldDictionary = new Dictionary <int, object>(); }
private void ProcessConfigurationFields( UPConfigAnalysisTable analysisTable, Dictionary <string, object> sourceFieldDict, AnalysisTable table) { foreach (var field in analysisTable.Fields) { var fieldInfo = sourceFieldDict.ValueOrDefault(field.Key) as AnalysisMetaInfoFieldInfo; if (fieldInfo == null) { continue; } List <object> subQueryFieldIndices = null; if (fieldInfo.SubFields?.Count > 0) { subQueryFieldIndices = new List <object>(); foreach (AnalysisMetaInfoFieldInfo subInfo in fieldInfo.SubFields) { subQueryFieldIndices.Add(subInfo.FieldIndex); } } var analysisSourceField = new AnalysisSourceField(table, field, fieldInfo.FieldIndex, subQueryFieldIndices); this.fieldDict.SetObjectForKey(analysisSourceField, analysisSourceField.Key); this.sourceFields.Add(analysisSourceField); table.AddSourceField(analysisSourceField); this.ProcessCategory(analysisSourceField); this.ProcessXCategory(analysisSourceField); if (analysisSourceField.IsCurrency) { this.SetCurrencyField(analysisSourceField); this.hasCurrencyField = true; } else if (analysisSourceField.IsTableCurrency) { table.AlternateCurrencyField = analysisSourceField; this.hasCurrencyField = true; } if (analysisSourceField.IsWeight) { this.SetWeightField(analysisSourceField); } if (analysisSourceField.IsFilter) { var analysisFilter = new AnalysisSourceFieldFilter(analysisSourceField); this.filters.Add(analysisFilter); } } }
/// <summary> /// Key with info area id /// </summary> /// <param name="infoAreaId">Info area id</param> /// <param name="occurrence">Occurrence</param> /// <returns>kKey</returns> public static string KeyWithInfoAreaIdOccurrence(string infoAreaId, int occurrence) { return(UPConfigAnalysisTable.KeyWithInfoAreaIdOccurrence(infoAreaId, occurrence)); }
/// <summary> /// Initializes a new instance of the <see cref="AnalysisCountField"/> class. /// </summary> /// <param name="analysis">Analysis</param> /// <param name="table">Table</param> /// <param name="queryResultTableIndex">Query result table index</param> public AnalysisCountField(Analysis analysis, UPConfigAnalysisTable table, int queryResultTableIndex) : base(analysis, table.Key) { this.ConfigTable = table; this.QueryResultTableIndex = queryResultTableIndex; }
/// <summary> /// Table with info area /// </summary> /// <param name="infoAreaId">Info area id</param> /// <param name="occurrence">Occurrence</param> /// <returns>Returns analysis table</returns> public AnalysisTable TableWithInfoAreaIdOccurrence(string infoAreaId, int occurrence) { return(this.TableWithKey(UPConfigAnalysisTable.KeyWithInfoAreaIdOccurrence(infoAreaId, occurrence))); }