Time Table Comparison & Comparison Time Filter for Dashboard #29732
Replies: 2 comments 2 replies
-
|
Hey @hamrio! I'm a bot here to help you with any issues, questions, or contributions. Feel free to ask for assistance! The rationale behind using a left outer join instead of a full outer join in the generated query for the experimental Time Comparison Table chart plugin is to ensure that all rows from the main dataset are included in the result, even if there are no matching rows in the comparison dataset. This approach helps maintain the integrity of the main dataset while still allowing for comparison data to be included where available [1]. To modify the join type to use a full outer join, you need to adjust the import { timeCompareOperator, TimeCompareJoinType } from '@superset-ui/chart-controls';
export default function buildQuery(formData: QueryFormData) {
const baseFormData = {
...formData,
};
const formData1 = removeFormDataSuffix(baseFormData, '_b');
const formData2 = retainFormDataSuffix(baseFormData, '_b');
const queryContexts = [formData1, formData2].map(fd =>
buildQueryContext(fd, baseQueryObject => {
const queryObject = {
...baseQueryObject,
columns: [
...(isXAxisSet(formData)
? ensureIsArray(getXAxisColumn(formData))
: []),
...ensureIsArray(fd.groupby),
],
series_columns: fd.groupby,
...(isXAxisSet(formData) ? {} : { is_timeseries: true }),
};
const pivotOperatorInRuntime: PostProcessingPivot = isTimeComparison(
fd,
queryObject,
)
? timeComparePivotOperator(fd, queryObject)
: pivotOperator(fd, queryObject);
const tmpQueryObject = {
...queryObject,
time_offsets: isTimeComparison(fd, queryObject) ? fd.time_compare : [],
post_processing: [
pivotOperatorInRuntime,
rollingWindowOperator(fd, queryObject),
timeCompareOperator(fd, queryObject, TimeCompareJoinType.FullOuter),
resampleOperator(fd, queryObject),
renameOperator(fd, queryObject),
flattenOperator(fd, queryObject),
],
} as QueryObject;
return [normalizeOrderBy(tmpQueryObject)];
}),
);
return {
...queryContexts[0],
queries: [...queryContexts[0].queries, ...queryContexts[1].queries],
};
}Regarding the comparison time filter on the dashboard, the current implementation works by overriding the time range in the query filters if extra form data is provided. This functionality is defined in the There are ongoing updates in the upcoming 4.1.0rc release that address the need for multiple time filters on the dashboard. Specifically, the following pull request highlights progress in this area:
Additionally, the new release includes tests for creating and applying time grain and time range filters, as seen in the |
Beta Was this translation helpful? Give feedback.
-
|
I don't think the time filter related. My question, is there any update regarding datetime selection filter on the dashboard for comparison time table? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I try the chart plugin experimental (Time Comparison Table). When I see the query after the chart is built, I see the chart is only use left outer join instead of full outer join. The query will lead to miss some data if the compare value has more dimension than the current value. or is that a reason to use left join instead full outer join?
Next question is about comparison time filter on the dashboard. I see the new table and it is good. I see the chart will be experimental release in 4.1.0rc. I think we also need new time filter for the dashboard because there will be chart have 2 time filter.
Thank you
Beta Was this translation helpful? Give feedback.
All reactions