Author Topic: Sorting of a Model View?  (Read 1283 times)

anderspe

  • EA User
  • **
  • Posts: 20
  • Karma: +0/-0
    • View Profile
Sorting of a Model View?
« on: October 19, 2017, 11:51:20 pm »
I have created a Model View which lists all elements of a specific stereotype but I am not able to sort the list in alphabetical order?

/Anders Pettersson

Glassboy

  • EA Practitioner
  • ***
  • Posts: 1086
  • Karma: +72/-71
    • View Profile
Re: Sorting of a Model View?
« Reply #1 on: October 20, 2017, 07:54:14 am »
I have created a Model View which lists all elements of a specific stereotype but I am not able to sort the list in alphabetical order?

If your question is "Am I able to sort alphabetically in a model view" then I believe the answer will be "yes you can".  You'll need some kind of ORDER BY in the SQL statement.

anderspe

  • EA User
  • **
  • Posts: 20
  • Karma: +0/-0
    • View Profile
Re: Sorting of a Model View?
« Reply #2 on: October 20, 2017, 05:28:18 pm »
Yes, my question are: Am I able to sort alphabetically in a model view?

I am using the Query Builder to setup the search and there is no function to define the sort order (as far as I have found)! Anyway  when I run the Search (Give me all elements of a specific Stereotype) the result displayed in the Search function is sorted alphabetically! When I am running the same search by the use of a model view the order in the model view seems to be random!?

Do I really need to use SQL in this case? I have no knowledge of the EA database structure and very limited knowledge of SQL!?

/Anders

qwerty

  • EA Guru
  • *****
  • Posts: 9590
  • Karma: +168/-148
  • I'm no guru at all
    • View Profile
Re: Sorting of a Model View?
« Reply #3 on: October 20, 2017, 06:54:51 pm »
Using SQL is the only way out, I guess. Or you have to send a feature request to pimp the Query Builder. They are anyway working in that area since the order triangle for the columns needs a fix.

q.

Glassboy

  • EA Practitioner
  • ***
  • Posts: 1086
  • Karma: +72/-71
    • View Profile
Re: Sorting of a Model View?
« Reply #4 on: October 24, 2017, 07:37:40 am »
Do I really need to use SQL in this case? I have no knowledge of the EA database structure and very limited knowledge of SQL!?

Post the SQL query from the model view and what attribute you want to search by and I'm sure someone can show you what to do.

qwerty

  • EA Guru
  • *****
  • Posts: 9590
  • Karma: +168/-148
  • I'm no guru at all
    • View Profile
Re: Sorting of a Model View?
« Reply #5 on: October 24, 2017, 08:18:04 am »
The query builder has two (actually 3 with the add-in) modes where one does not show/need SQL. That part will not accept an ORDER BY.

q.