INTERACT FORUM

Please login or register.

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

Author Topic: Groupcount Expression Help  (Read 519 times)

locust

  • Citizen of the Universe
  • *****
  • Posts: 699
Groupcount Expression Help
« on: April 01, 2021, 01:39:31 pm »

Hi, I was wondering if it's possible to use the IfCase function upon the output of the GroupCount function?

So that if the output of GroupCount is less than 2, then using listbuild to tuck away those entries under a hierarchy in the pane. The pseudo folder of less than two pinned to the top of the pane (just using a character that will ensure it stays at the top before "a" such as "!" then for all entries that have 2 or more than 2 just normally listed in the pane.

I haven't been specific in my use for this as I think I could use it upon my photos and music. So lets say Number of albums of an artist.

Any help would be appreciated but I have the gut feeling that I can't use expressions upon the output of groupcount in a pane?

Thanks
Logged

locust

  • Citizen of the Universe
  • *****
  • Posts: 699
Re: Groupcount Expression Help
« Reply #1 on: April 02, 2021, 02:48:48 am »

This is as far as I've got but it isn't working correctly. It just isn't making it into a hierarchy and I can't figure out why. But Ifcase is working on the output of Groupcount at least.

Admittedly, I'm not the best at making expressions lol.

Expression to group by
Code: [Select]
[Group ID]&datatype=[list]
Expression to display
Code: [Select]
listbuild(1, \,
IfCase(GroupCount(), 3, 2, !!Less Than 2),
[Group ID, 1] (GroupCount()))&datatype=[list]
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2615
Re: Groupcount Expression Help
« Reply #2 on: April 02, 2021, 04:04:13 am »

This is likely not possible. The split would need to be done on the "expression to group by", not the Display expression, but when the grouping expression is being evaluated there aren't yet any groups... so GroupCount() doesn't have a meaningful value there.

If your [Group ID] field is NOT a list, you could create 2 views and use "Set Rules for File Display" to filter for Groups with count<=2 in one view and >2 in the other.
Logged

locust

  • Citizen of the Universe
  • *****
  • Posts: 699
Re: Groupcount Expression Help
« Reply #3 on: April 02, 2021, 08:55:59 am »

Thanks zybex. Yeah the group id is field is indeed a list. I'll probably just leave it then. I'm a bit of a tag perfectionist and was hopefully looking for a way to hide those entries in the pane but still have access to them. I can live with it though Thanks again for your help.
Logged
Pages: [1]   Go Up