Currently, VA does not support sorting on a table calculation field. Enhance VA to support this requirement.
145 KB
142 KB
118 KB
114 KB
118 KB
116 KB
116 KB
295 KB
295 KB
There are certain table calculations whose values are dependent on the order, and changing the order will change the values as well. For example:
So what does it mean to sort the table calc values? One possible interpretation is to sort (null, 2, -5, -2, 1), resulting in (null, -5, -2, 1, 2), which causes the column headers to sort as (A, C, D, E, B). Thus we will end up with the following:
Note that the Table calc values themselves are changed due to the way they are computed. Thus this particular sorting scenario does NOT seem to make sense; one does not expect a sort operation to modify the values that are being sorted.
However, if there are multiple rows, then sorting in the vertical direction is still valid.
Thus we should allow sorting by table calculation values only when the sorting itself does NOT change the table calc values. For example, when the table calc is computed horizontally, then sorting vertically is allowed, and vice versa, and also allow sorting when the order of the original values does not affect the final values of the table calculations (i.e. % of total table calc).
In this ticket, we will add the following sorting scenarios involving table calculations:
Please find attached screenshots
@Nhi just one question, Do we have to sort on Difference?
Thanks
Pankaj
Please find attached screenshots
@Nhi just one question, Do we have to sort on Difference?
Thanks
Pankaj
@nhi from your above comment
"Note that the Table calc values themselves are changed due to the way they are computed. Thus this particular sorting scenario does NOT seem to make sense; one does not expect a sort operation to modify the values that are being sorted."
So Do we need to add sorting for "difference" ?
Thanks
[Nhi] We just need to implement #1 and #2 at the bottom of this comment. Per #2 we allow sorting the "difference" only in the perpendicular direction. For example if table calc is "table across", then allow sorting in vertical direction, but not allow sorting in horizontal direction.
@nhi from your above comment
"Note that the Table calc values themselves are changed due to the way they are computed. Thus this particular sorting scenario does NOT seem to make sense; one does not expect a sort operation to modify the values that are being sorted."
So Do we need to add sorting for "difference" ?
Thanks
[Nhi] We just need to implement #1 and #2 at the bottom of this comment. Per #2 we allow sorting the "difference" only in the perpendicular direction. For example if table calc is "table across", then allow sorting in vertical direction, but not allow sorting in horizontal direction.
Thanks Nhi for quick reply.
All required Changes checked as per your comment. at Revision: 56042, Please have a look and let me know if anything we missed.
Thanks
Pankaj
Thanks Nhi for quick reply.
All required Changes checked as per your comment. at Revision: 56042, Please have a look and let me know if anything we missed.
Thanks
Pankaj
[Nhi] I don't remember this code. However, just commenting it out will cause another scenario to fail. For example, if the code is commented out, this scenario will allow sorting in both vertical and horizontal direction, which is incorrect; please see #2 in this comment. Thus you'll need to either fix up the mentioned code, or add other logic if you comment it out. Just make sure both #1 and #2 are satisfied and that no other existing supported sort scenarios are broken.
Please also fix the following scenarios.
Scenario 1
Scenario 2
[Nhi] I don't remember this code. However, just commenting it out will cause another scenario to fail. For example, if the code is commented out, this scenario will allow sorting in both vertical and horizontal direction, which is incorrect; please see #2 in this comment. Thus you'll need to either fix up the mentioned code, or add other logic if you comment it out. Just make sure both #1 and #2 are satisfied and that no other existing supported sort scenarios are broken.
Please also fix the following scenarios.
Scenario 1
Scenario 2
The following scenario is broken:
Scenario 3:
Scenario 4:
Scenario 5:
After you fix this, please verify that when table calc is Table(Across), then sorting vertically is allowed, but sorting horizontally is not allowed. And when table calc is Table(Down), then sorting vertically is not allowed, but sorting horizontally is allowed. You should also swap rows/columns, and validate the same. Also validate the same in Chart mode.
The following scenario is broken:
Scenario 3:
Scenario 4:
Scenario 5:
After you fix this, please verify that when table calc is Table(Across), then sorting vertically is allowed, but sorting horizontally is not allowed. And when table calc is Table(Down), then sorting vertically is not allowed, but sorting horizontally is allowed. You should also swap rows/columns, and validate the same. Also validate the same in Chart mode.
Hi Nhi,
For Rank table calculation, the sorting is happening in opposite way. see below scenario:
Hi Nhi,
For Rank table calculation, the sorting is happening in opposite way. see below scenario:
Seems like the sorting scenarios are enabled and working in Table mode, but not enabled in Chart mode, which is incorrect. All scenarios in this issue must be enabled and work for both Table and Chart mode.
Scenario 1:
Scenario 2:
Scenario 3:
Scenario 4:
Seems like the sorting scenarios are enabled and working in Table mode, but not enabled in Chart mode, which is incorrect. All scenarios in this issue must be enabled and work for both Table and Chart mode.
Scenario 1:
Scenario 2:
Scenario 3:
Scenario 4:
We have verified all the above scenarios and its working fine on Dev-46 build.
We have verified all the above scenarios and its working fine on Dev-46 build.
It seems like the logic in the following block of code in BIModel, line 1487 is a bit strange:
if (hasTableCalculation) { _allowSortByLeafColumn = _allowSortByColumn && (!_fieldsAPI.isDataInColumns() || _fieldsAPI.getDataFieldCount() < 2); _allowSortByLeafRow = _allowSortByRow && (!_fieldsAPI.isDataInRows() || _fieldsAPI.getDataFieldCount() < 2); } else { _allowSortByLeafColumn = _allowSortByColumn && !hasTableCalculation && (!_fieldsAPI.isDataInColumns() || _fieldsAPI.getDataFieldCount() < 2); _allowSortByLeafRow = _allowSortByRow && !hasTableCalculation && (!_fieldsAPI.isDataInRows() || _fieldsAPI.getDataFieldCount() < 2); }
It can be simplified as follows:
_allowSortByLeafColumn = _allowSortByColumn && (!_fieldsAPI.isDataInColumns() || _fieldsAPI.getDataFieldCount() < 2); _allowSortByLeafRow = _allowSortByRow && (!_fieldsAPI.isDataInRows() || _fieldsAPI.getDataFieldCount() < 2);
Please fix and re-test.
It seems like the logic in the following block of code in BIModel, line 1487 is a bit strange:
if (hasTableCalculation) { _allowSortByLeafColumn = _allowSortByColumn && (!_fieldsAPI.isDataInColumns() || _fieldsAPI.getDataFieldCount() < 2); _allowSortByLeafRow = _allowSortByRow && (!_fieldsAPI.isDataInRows() || _fieldsAPI.getDataFieldCount() < 2); } else { _allowSortByLeafColumn = _allowSortByColumn && !hasTableCalculation && (!_fieldsAPI.isDataInColumns() || _fieldsAPI.getDataFieldCount() < 2); _allowSortByLeafRow = _allowSortByRow && !hasTableCalculation && (!_fieldsAPI.isDataInRows() || _fieldsAPI.getDataFieldCount() < 2); }
It can be simplified as follows:
_allowSortByLeafColumn = _allowSortByColumn && (!_fieldsAPI.isDataInColumns() || _fieldsAPI.getDataFieldCount() < 2); _allowSortByLeafRow = _allowSortByRow && (!_fieldsAPI.isDataInRows() || _fieldsAPI.getDataFieldCount() < 2);
Please fix and re-test.
Thanks Nhi.
Fixed above code and its working fine.
Thanks Nhi.
Fixed above code and its working fine.
The code refactoring in BIChartHeaderHoverHandler is invalid as it cause breakage in the following scenario. Please revert the changes in BIChartHeaderHoverHandler that was part of Revision 56205.
java.lang.ArrayIndexOutOfBoundsException: 0
at com.aquafold.aquacore.open.chart.bi.BIChartHeaderHoverHandler.isAllowSorting(BIChartHeaderHoverHandler.java:174)
at com.aquafold.aquacore.open.chart.bi.BIChartHeaderHoverHandler.handleSelection(BIChartHeaderHoverHandler.java:114)
at com.aquafold.aquacore.open.chart.bi.BIChartPanel$BIChartMouseAdapter.mouseMoved(BIChartPanel.java:1025)
at java.awt.Component.processMouseMotionEvent(Component.java:6578)
at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:3342)
at java.awt.Component.processEvent(Component.java:6302)
at java.awt.Container.processEvent(Container.java:2238)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2296)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4897)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4475)
at java.awt.Container.dispatchEventImpl(Container.java:2282)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
at java.awt.EventQueue$4.run(EventQueue.java:733)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:866)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:650)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:381)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
The code refactoring in BIChartHeaderHoverHandler is invalid as it cause breakage in the following scenario. Please revert the changes in BIChartHeaderHoverHandler that was part of Revision 56205.
java.lang.ArrayIndexOutOfBoundsException: 0
at com.aquafold.aquacore.open.chart.bi.BIChartHeaderHoverHandler.isAllowSorting(BIChartHeaderHoverHandler.java:174)
at com.aquafold.aquacore.open.chart.bi.BIChartHeaderHoverHandler.handleSelection(BIChartHeaderHoverHandler.java:114)
at com.aquafold.aquacore.open.chart.bi.BIChartPanel$BIChartMouseAdapter.mouseMoved(BIChartPanel.java:1025)
at java.awt.Component.processMouseMotionEvent(Component.java:6578)
at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:3342)
at java.awt.Component.processEvent(Component.java:6302)
at java.awt.Container.processEvent(Container.java:2238)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2296)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4897)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4475)
at java.awt.Container.dispatchEventImpl(Container.java:2282)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
at java.awt.EventQueue$4.run(EventQueue.java:733)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:866)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:650)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:381)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Looks good.
@QA: Please test and verify the issue.
Looks good.
@QA: Please test and verify the issue.
Hi, we have verified all the above scenarios and its working fine on Dev-51 build.
Hi, we have verified all the above scenarios and its working fine on Dev-51 build.
Issue #15245 |
Verified |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build ADS-19.5.0-dev-51 |
No time estimate |
2 issue links |
relates to #15625
Issue #15625For Rank table calculation, the sorting is happening in opposite way |
relates to #15551
Issue #15551Add the ability to sort Measures in Visual Analytics |
There are certain table calculations whose values are dependent on the order, and changing the order will change the values as well. For example:
So what does it mean to sort the table calc values? One possible interpretation is to sort (null, 2, -5, -2, 1), resulting in (null, -5, -2, 1, 2), which causes the column headers to sort as (A, C, D, E, B). Thus we will end up with the following:
Note that the Table calc values themselves are changed due to the way they are computed. Thus this particular sorting scenario does NOT seem to make sense; one does not expect a sort operation to modify the values that are being sorted.
However, if there are multiple rows, then sorting in the vertical direction is still valid.
Thus we should allow sorting by table calculation values only when the sorting itself does NOT change the table calc values. For example, when the table calc is computed horizontally, then sorting vertically is allowed, and vice versa, and also allow sorting when the order of the original values does not affect the final values of the table calculations (i.e. % of total table calc).
In this ticket, we will add the following sorting scenarios involving table calculations: