INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Expression Sort / Grouping query  (Read 631 times)

stricko

  • Galactic Citizen
  • ****
  • Posts: 426
Expression Sort / Grouping query
« on: January 13, 2022, 12:12:05 am »

Hi there,

So I'm in Theatre View, trying to resolve the issue about movies with the same title. Nothing clever, I'm trying to use the Year field to differentiate the movies. In my query grouping expression, I have the value [Name] [Year]. But this returns the following result

Toy Story 2 1999
Toy Story 3 2010
Toy Story 1995

How do I rewrite my grouping expression to put Toy Story at the top of the results?

Many thanks
Logged

EnglishTiger

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1115
Re: Expression Sort / Grouping query
« Reply #1 on: January 13, 2022, 02:26:52 am »

Looks to me like the Sort is being done on Name - try changing it to Year or maybe Name within Year
Logged
Apple Mac Mini Desktop Computer with M4 Pro chip with 12 core CPU and 16 core GPU: 24GB Unified Memory, 512GB SSD Storage, Gigabit Ethernet, 3 Thunderbolt5 + 2USBC ports.

stricko

  • Galactic Citizen
  • ****
  • Posts: 426
Re: Expression Sort / Grouping query
« Reply #2 on: January 14, 2022, 05:51:53 am »

Sorry, I probably didn't make myself clear. I definitely want the films sorted by name. It's primarily to resolve issues with multiple films have exactly the same name. Like Crash, True Grit, War of the World's etc etc etc. My query works perfectly for that. But, it has the wierd side effect shown in my original post.

I assumed that my [Name]  [Year] would either sort by name first, in which case Toy Story should come before Toy Story 2, or produce a string where Toy Story 1995. Should come before Toy Story 2

Or am I missing something. I tried exactly the same data in Excel, and the sort results are as I expect
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2674
Re: Expression Sort / Grouping query
« Reply #3 on: January 14, 2022, 07:43:55 am »

Try:
Expression to group by = [Name]
Expression to Display = [Name] ​([Year])
Sorting: Ascending

You can also use a different expression on the "group by" and then set Sorting="Name".

Logged
Pages: [1]   Go Up