Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Notifications
Login / Register
Community
Community
Notifications
close
  • Forums
  • Knowledge Center
  • Events & Webinars
  • Ideas
  • Blogs
Help
Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Login / Register
Sustainability
Sustainability

Join our "Ask Me About" community webinar on May 20th at 9 AM CET and 5 PM CET to explore cybersecurity and monitoring for Data Center and edge IT. Learn about market trends, cutting-edge technologies, and best practices from industry experts.
Register and secure your Critical IT infrastructure

Embedded Query, add ability to sort by hidden column tied to visible column (i.e. for natural sorting of current value formatted)

Geo SCADA and Remote Operations Devices Ideas

Use this portal to submit your innovative ideas to make Geo SCADA Expert and Devices such as SCADAPack, Trio and Realflo of greater value to you and to the SCADA & Telemetry community. Every idea will be individually reviewed by our team for merit and will be marked Under Consideration.

cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Home
  • Schneider Electric Community
  • Remote Operations
  • Geo SCADA and Remote Operations Devices Ideas
  • Embedded Query, add ability to sort by hidden column tied to visible column (i.e. for natural sorting of current value format...
Options
  • Subscribe to RSS Feed
  • Mark as New
  • Mark as Read
  • Bookmark
  • Subscribe
  • Email to a Friend
  • Printer Friendly Page
  • Report Inappropriate Content
Invite a Co-worker
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send Invite Cancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close
Labels
Top Labels
  • Alphabetical
  • SCADA 2
  • ViewX 2
  • Mimics 2
  • SCADAPack 2
  • Scripting 1
  • Virtual ViewX 1
  • Geo SCADA Expert 1
  • Efficiency 1
  • Configuration management 1
  • Modbus to WiStar 1
Idea Statuses
  • Submitted 9
  • Under consideration 126
  • Accepted 1
  • Declined 4
  • Partially delivered 0
  • Delivered 0
  • Abandoned 0
Related Products
Thumbnail of EcoStruxure™ Geo SCADA Expert
Schneider Electric
EcoStruxure™ Geo SCADA Expert
112
Thumbnail of SCADAPack 57x
Schneider Electric
SCADAPack 57x
2
Thumbnail of Accutech
Schneider Electric
Accutech
1
Load more
Completed Ideas
  • Accutech Modbus Master gateway to read Modbus devices and incorporate into WiStar net

  • Controller Key Enhancement

  • Restore "Embed Source Code for Upload" Option in Workbench (SP300 family)

  • DNP Outstation And DNP Master Diagnostics

View All

Invite a Colleague

Found this content useful? Share it with a Colleague!

Invite a Colleague Invite
1 Like

Embedded Query, add ability to sort by hidden column tied to visible column (i.e. for natural sorting of current value formatted)

Status: Under consideration Submitted by Spock BevanWeiss on ‎2020-11-10 02:02 PM
6 Comments (6 New)

We often use embedded query lists to present data, since they allow for a large amount of data to be presented, which easily accommodates the addition of new sites / information points to the list of data.

 

One issue we have however, is that we want the data presentation to appear 'pretty', that is that values should display alongside their units.  So if we have wet well levels, we would want the data column to appear as '43 %' or '946 mm'.  However, we also want it to be sorted naturally, and not lexigraphically (by character).

 

Currently if we have three values, '9 %', '10 %' and '91 %' if the user sorts by this column (ascending) it will display as

'10 %'

'9 %'

'91 %'

 

When what we want is:

'9 %'

'10 %'

'91 %'

 

As the current value formatted column is simply a string, then I don't think there is anything that the embedded query list should do for this.

BUT... what I think should be possible is to have a 'special column' similar to what exists for the foreground, background, blink columns. it could be sortorder or similar.  It would mean that when the following column is 'sorted' then the values in the 'sortorder' column preceeding it are actually used instead of the selected column values.

 

In this way if we had a query that looked like:

SELECT Name, CurrentValueAsReal as "{sortorder}", CurrentValueFormatted as "Value"

FROM TABLE

 

If the user clicked on the Value heading to sort, it would sort 'correctly' in accordance with the CurrentValueAsReal column, hence smallest at the top and largest at the bottom (or vice versa), and the world would be a better place 🙂

Tags (6)
  • Find more ideas tagged with:
  • english
  • scada
  • SCADA app
  • SCADA software
  • SCADA tutorial
  • Telemetry and SCADA
Comment

Link copied. Please paste this link to share this article on your social media post.

  • Back to Idea Exchange
  • Previous
  • Next
6 Comments
AdamWoodland
AdamWoodland Schneider Alumni (Retired)
Schneider Alumni (Retired)
‎2020-11-10 04:54 PM
  • Mark as Read
  • Mark as New
  • Bookmark
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content
‎2020-11-10 04:54 PM

You can effectively do this currently by just aliasing a hidden column (prefix with _) and then specify that alias in the ORDER BY, the only issue would be if the user clicks a header for their own sort on the non-maths column and it all goes to pot.

 

SELECT
 NAME, CURRENTVALUEFORMATTED, CURRENTVALUEASREAL AS "_Sort"
FROM
 CDBPOINT
WHERE
 FULLNAME LIKE 'zTest.%'
ORDER BY
 "_Sort" ASC

 

 

 

 

BevanWeiss
Spock BevanWeiss
Spock
‎2020-11-10 05:29 PM
  • Mark as Read
  • Mark as New
  • Bookmark
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content
‎2020-11-10 05:29 PM

Hi Adam,

It's exactly for the user-driven sorts that we would want this.

 

We've never got a problem having the table default sorted.

As you mention, just a hidden column and a static ORDER BY clause.

 

But the users often (read: always) want to slice/dice our embedded queries based on other things... like Estimated Time To Spill, or Estimated Infiltration Rate, or Estimated Inflow Rate, or Candelabras per Gazebo.. etc etc etc..  values need units, and hence all of our columns have units displayed for them.

AdamWoodland
AdamWoodland Schneider Alumni (Retired)
Schneider Alumni (Retired)
‎2020-11-11 01:08 PM
  • Mark as Read
  • Mark as New
  • Bookmark
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content
‎2020-11-11 01:08 PM

Its almost as though to need to alias (bad use of wording but I'm going with it) the column as something else for the purpose of sorting, i.e.

 

SELECT Name, CurrentValueFormatted AS "CurrentValue" SORT CurrentValueAsReal FROM CDBPoint

 

No idea what the SQL spec allows for though, I just made that up 🙂

BevanWeiss
Spock BevanWeiss
Spock
‎2020-11-12 02:49 AM
  • Mark as Read
  • Mark as New
  • Bookmark
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content
‎2020-11-12 02:49 AM

Nice idea, but I think it's in the display side that the issue arises.

Since it's the user performing the sort determination by clicking the header of the column.

I don't think anything in the 'pure' SQL side would resolve the issue.  I think it would need to be in the presentation side (ViewX).. but would need to have the information available from the SQL side (e.g. via the special column syntax that I mentioned.. which is kind of inline with the current foreground, background stuff).

 

My thought there is that ViewX itself wouldn't be doing the quicksort or similar itself, just when the user clicks on the heading column, instead of ViewX appending 'ORDER BY "CurrentValueFormatted" ASC' it would append 'ORDER BY "{sortorder1}" ASC', which would also handle nested sorts trivially, in the same way the current SQL Embedded Query List stuff does...

e.g. a query like

SELECT

  CurrentValueAsReal AS {sortorder1}, CurrentValueFormatted AS Value,

  HighHighLimitStd AS {sortorder2}, FORMATVALUE(HighHighLimitStd USING Format || ' ' || Unit ) AS HighHigh,

  HighLimitStd AS {sortorder3}, FORMATVALUE(HighLimitStd USING Format || ' ' || Unit ) AS High,

  LowLimitStd AS {sortorder4}, FORMATVALUE(LowLimitStd USING Format || ' ' || Unit ) AS Gazebos,

  LowLowLimitStd AS {sortorder5}, FORMATVALUE(LowLowLimitStd USING Format || ' ' || Unit ) AS Candelabras

FROM CDNP3AnalogIn

 

would be able to have nested sorting created by a user clicking on any of the 5 column headings, and it would sort it nicely using the provided sort columns which could end up like

SELECT

  CurrentValueAsReal AS {sortorder1}, CurrentValueFormatted AS Value,

  HighHighLimitStd AS {sortorder2}, FORMATVALUE(HighHighLimitStd USING Format || ' ' || Unit ) AS HighHigh,

  HighLimitStd AS {sortorder3}, FORMATVALUE(HighLimitStd USING Format || ' ' || Unit ) AS High,

  LowLimitStd AS {sortorder4}, FORMATVALUE(LowLimitStd USING Format || ' ' || Unit ) AS Gazebos,

  LowLowLimitStd AS {sortorder5}, FORMATVALUE(LowLowLimitStd USING Format || ' ' || Unit ) AS Candelabras

FROM CDNP3AnalogIn

ORDER BY

  {sortorder2} ASC, {sortorder1} DESC, {sortorder3} ASC, {sortorder4} ASC, {sortorder5} DESC

 

Not a super super nice query (since the sort columns lose some context).. but it would be pretty functional, and should be a pretty easy ViewX code change 😉

sbeadle
Kirk sbeadle Kirk
Kirk
‎2020-12-21 07:49 AM
  • Mark as Read
  • Mark as New
  • Bookmark
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content
‎2020-12-21 07:49 AM
Status changed to: Under consideration

Hidden columns (preceded with underscore) can be sorted in the query SQL, but if you click on another column to sort, you can't then click on a hidden column to resort.

Thank you.

du5tin
Lt. Commander du5tin
Lt. Commander
‎2021-09-27 04:26 PM
  • Mark as Read
  • Mark as New
  • Bookmark
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content
‎2021-09-27 04:26 PM

Similar, but not the same... we have lists of wells on our systems and we format the column as as string with a limited number of significant figures to make the column width reduce (float columns are extremely wide!). When we do this the columns are sorted as strings. We have worked around it like Bevan has by padding the front of the column with spaces which actually makes the column appear to sort properly again. For example, 1.0 might have two spaces padding the front and 100.0 has no spaces padding the front. 

It would be great to get the column widths down for numbers too. But using format value on a number column should hopefully still sort like a number. Maybe that is something can get tweaked in the SQL interpreter?

Comment
Preview Exit Preview

never-displayed

Hint:
@ links to members, content
 
  • Back to Idea Exchange
  • Previous
  • Next
To The Top!

Forums

  • APC UPS Data Center Backup Solutions
  • EcoStruxure IT
  • EcoStruxure Geo SCADA Expert
  • Metering & Power Quality
  • Schneider Electric Wiser

Knowledge Center

Events & webinars

Ideas

Blogs

Get Started

  • Ask the Community
  • Community Guidelines
  • Community User Guide
  • How-To & Best Practice
  • Experts Leaderboard
  • Contact Support
Brand-Logo
Subscribing is a smart move!
You can subscribe to this board after you log in or create your free account.
Forum-Icon

Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.

Register today for FREE

Register Now

Already have an account? Login

Terms & Conditions Privacy Notice Change your Cookie Settings © 2025 Schneider Electric

This is a heading

With achievable small steps, users progress and continually feel satisfaction in task accomplishment.

Usetiful Onboarding Checklist remembers the progress of every user, allowing them to take bite-sized journeys and continue where they left.

of