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 526 times)

stricko

  • Galactic Citizen
  • ****
  • Posts: 423
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

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 969
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
Win NUC - VENOEN 11Th NUC Mini PC Core i7 1165G7,Dual HDMI 2.0+Mini DP,Windows 11 Mini Desktop Computer,Thunderbolt 4.0,1 Lan, USB-C,Wifi,Bluetooth 5.0,32GB RAM Toshiba MQ04ABF100 ‎500Gb 5400 RPM ‎eSATA HD, Gigabyte GP-GSM2NE3512GNTD 1Tb NVMe SSD, Samsung 870 QVO 8 TB SATA 2.5 Inch SSD (MZ-77Q8T0) in Sabrent Ultra Slim USB 3.0 to 2.5-Inch SATA External Aluminium Hard Drive Enclosure (EC-UK30)

Apple 2020 Mac mini M1 Chip (8GB RAM, 512GB SSD)
Sabrent Thunderbolt 3 to Dual NVMe M.2 SSD Tool-Free Enclosure with Sabrent 2TB Rocket NVMe PCIe M.2 2280 High Performance SSD + Crucial P3 Plus 4TB M.2 PCIe

ET Skins & TrackInfo Plugins - https://englishtiger.uk/index.html

stricko

  • Galactic Citizen
  • ****
  • Posts: 423
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: 2400
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