INTERACT FORUM

Please login or register.

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

Author Topic: Using Expressions in the Categories View  (Read 689 times)

dreandre

  • Junior Woodchuck
  • **
  • Posts: 66
Using Expressions in the Categories View
« on: January 29, 2023, 04:58:55 pm »

Hello all!  I'm looking for help with Expressions when using Categories View for videos.

Setup
I'm using the Artist field, which will only allow a single artist at a time.  I'm also using a custom field that I'm calling "Featured Artists" that I have set up as a list to allow multiple artists per Video.

Example 1.
Artist: Lisa "Left Eye" Lopes
Song: The Block Party

Example 2.
Artist: Lil Kim
Song: Ladies Night
Featured Artists: Missy Elliott, Da Brat, Lisa "Left Eye" Lopes, Angie Martinez

The Challenge
I would like to write the expression to look at both the Artist, and the Featured Artist fields, and group all of the the instances of videos that contain Lisa "Left Eye" Lopes, and show it in the Categories as Lisa "Left Eye" Lopes.

The result in this example would give me the following Categories:
Lisa "Left Eye" Lopes
Lil Kim
Missy Elliott
Da Brat
Angie Martinez


Extra Credit
To make it more complicated, I was also wondering if I should include the Performer field which would then look like this:

Example 3
Artist: TLC
Performers: Tionne "T-Boz" Watkins, Rozonda "Chilli" Thomas, Lisa "Left Eye" Lopes
Song: Can You Hear Me
Featured Artists: Missy Elliot

This would then give me an added category called "TLC" which would group anything that Lisa "Left Eye" Lopes has done as part of TLC, as featured, and as a solo artist.

What are your thoughts??  And thanks ahead for your time and knowledge!
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2362
Re: Using Expressions in the Categories View
« Reply #1 on: January 30, 2023, 02:28:23 am »

You can combine lists with
ListCombine([Artist], [Featured Artist], ;, ;, 0)

To combine 3 lists just use ListCombine twice:
ListCombine(ListCombine([Artist], [Featured Artist], ;, ;, 0), [Performer], ;, ;, 0)

Note that [Artist] is actually a List field, not a single-artist field. Names in list fields should be separated;by;semicolons, though you can specify a different separator in ListCombine().
Logged

dreandre

  • Junior Woodchuck
  • **
  • Posts: 66
Re: Using Expressions in the Categories View
« Reply #2 on: May 05, 2023, 12:29:12 am »

It's been a while since I had some down time to play in the App... sorry just getting back to this.

So ListCombine doesn't quite get me there.  Using ListCombine only is giving me two categories that look like this:


Category 1 Lisa "Left Eye" Lopes
which has this song: The Block Party

Category 2 Lil Kim;Missy Elliott;Da Brat;Lisa "Left Eye" Lopes;Angie Martinez
Which has the song: Ladies Night
(Combining the Artist and the Featured Artists using the ; delimiter.)

What I'm looking for is to have both songs show up under the Category name, since she is in both songs:

Category 1 Lisa "Left Eye" Lopes
which has this song: The Block Party (Because of the Artist as a solo)
And this song: Ladies Night (Because of the Featured Artist of Lil Kim)
And this song: Can You Hear Me (Because of the Performer in TLC)

Likewise, There would be:
Category for TLC (because it was the Artist)
Category for Tionne "T-Boz" Watkins (because she was the Performer in TLC)
Category for Lil Kim with Ladies Night (Because she was the Artist)
Category for Missy Elliott (Because She was a featured artist for Lil Kim)
etc....

I realize this will cause one song to appear in more than one category because of the multiple artists that are on the song.  Like one to many relationship in a database.

Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2362
Re: Using Expressions in the Categories View
« Reply #3 on: November 04, 2023, 12:32:05 pm »

Sorry for the late reply.
You can create the view you want in 2 different ways:

1. create a new field to hold the combined names, then use it as a Category on the View. Expression for the field:
Code: [Select]
ListCombine(ListCombine([Artist], [Featured Artist]), [Performer])
2. create a View with a Category of type "Expression", with this "expression to group by":
Code: [Select]
ListCombine(ListCombine([Artist], [Featured Artist]), [Performer])&DataType=[List]Leave the "expression to display" as blank.

The first method allows you to enable the "grouping" box which further divides the list with an alphabet.
Logged

dreandre

  • Junior Woodchuck
  • **
  • Posts: 66
Re: Using Expressions in the Categories View
« Reply #4 on: November 04, 2023, 02:56:00 pm »

Thank you!

I will try both methods and see which I like best.  I'll post how it went!
Logged
Pages: [1]   Go Up