You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix to support composite key columns (GroupByColumns) in StatExtractor.
This update resolves an issue in StatExtractor where an error occurred during the extraction of relationship statistics when one of the columns in the relationship was part of a composite key (GroupByColumns). The error message was: "Column [] is part of composite key, but not all columns of the composite key are included in the expression or its dependent expression." This fix applies only to models with a compatibility level of 1200 or higher, as GroupByColumns is not available in levels 1100 and 1103.
// We always use COUNTROWS(ALLNOBLANKROW(t[c])) instead of DISTINCTCOUNT(t[c]) because it is compatible with GroupByColumns settings, such as Fields Parameters.
241
-
// COUNTROWS(ALLNOBLANKROW()) always reads the list of values from the attribute hierarchy (when AvailableInMDX=true) or queries the table if the hierarchy is not available (when AvailableInMDX=false)
240
+
varcolumnName=EscapeColumnName(column);
241
+
242
+
if(column.GroupByColumns.Count==0){
243
+
return$"DISTINCTCOUNT({columnName})";
244
+
}
245
+
else{
246
+
// COUNTROWS(ALLNOBLANKROW(t[c])) is compatible with GroupByColumns settings like Fields Parameters because it always retrieves the list of
247
+
// values from the attribute hierarchy (when AvailableInMDX=true), or queries the table if the hierarchy is unavailable (AvailableInMDX=false).
0 commit comments