INTERACT FORUM

Please login or register.

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

Author Topic: Expression Help  (Read 2208 times)

SeaDrive

  • World Citizen
  • ***
  • Posts: 173
Expression Help
« on: October 15, 2009, 10:20:07 am »

Now that I've identified the people in my images with Picassa I'm trying to better organize. I've saved the data in the keyword tag and then copied to the People tag as many others have. I then have a smartlist and a theater view grouped by person. This works very well. The problem... I have too many people. Although I like to tag as many friends and family members as possible, I don't always want to scroll through the whole list to view pictures of my immediate family. I can't just create a view where people is any "Bob, Sue, Timmy or Lisa" because I also get all other people present in the pictures. What I was thinking is to create a new library field named "Family People" This field will only contain the names of the family members and can be used to create the new view. I thought that I could make this a calculated field and only list the names of family members. I've run into a couple of issues.

1) I though I could do something like "if(isequal([People,8],Bob,1),Bob,)" and I would be able to substring the delimited list for "Bob" in any position. This doesn't seem to work on a list. Instead I had to create a nested condition with "Listitem" checking each list position at a time. Is this the only way? Is there an easier way to loop through the list with less code?

2) Assuming that that I use some method from above to populate the "Family People" list (Right now I'm usin the nested approach) I need to assemble the calculated data into a list so it can be used for grouping. My first instinct was to just use the "Listbuild" command with each indiviual as a separate entry. This actually builds a delimited list as I had hoped but it seems that a calculated field does not really conform to the rules of a true list. Individual names work great but once there is more than 1 member in the list it attempts to create a group of the combination. For example, "Bob" or "Mary" alone work greate but "Bob;Mary" actually create a grouping named "Bob;Mary." Any ideas? Right now I used this buildlist logic to populate a temporary family people filed and then I have to copy the data from the temporary field into a true list field for it to work properly.

Obviously I'm trying to automate the process so that simple adding new images that contain family members will automatically group properly without any manual steps. Any suggestions would be greatly appreciated.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72439
  • Where did I put my teeth?
Re: Expression Help
« Reply #1 on: October 15, 2009, 10:35:24 am »

doof is working on something similar.  It would be worth reading his recent posts.

http://yabb.jriver.com/interact/index.php?topic=54158.0
Logged

SeaDrive

  • World Citizen
  • ***
  • Posts: 173
Re: Expression Help
« Reply #2 on: October 15, 2009, 11:03:59 am »

I already checked that out. I already have Picassa tagging the images and I have access via the Keywords tag. I'm really just trying to create a subset of the names that have been included in the keyword tag. That would be easy enough with the proper filtering. the problem arises when there are immediate family members and other people in the same images. Because there are immediate family members the images are included in the list (as I would expect.) But because there are also othe rpeople, when I group by keyword I get a separate grouping fo rthese people as well. The idea is to have a field that can be calculated to only populate a certain set of names so I can filter and group by this data. Something like "Only calculate or display the names 'Bob', 'Mary', ' Tim' and 'Lisa' from the Keywords list in the Family People field."
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72439
  • Where did I put my teeth?
Re: Expression Help
« Reply #3 on: October 15, 2009, 11:15:11 am »

Why don't you copy your questions to the other thread?
Logged

gappie

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4580
Re: Expression Help
« Reply #4 on: October 15, 2009, 11:16:23 am »

to make a list from the calculated data put
Code: [Select]
&datatype=[list] behind it or in the view.

 :)
gab
Logged

gappie

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4580
Re: Expression Help
« Reply #5 on: October 15, 2009, 11:22:15 am »

actually this seems to work... two other people and easy to add others:
Code: [Select]
if(isequal([People],gab,8),gab;,)if(isequal([People],elly,8),elly;,)&datatype=[list]
 :)
gab
Logged

SeaDrive

  • World Citizen
  • ***
  • Posts: 173
Re: Expression Help
« Reply #6 on: October 15, 2009, 11:30:29 am »

Thanks gappie. That appears to do it. It looks like I either mis-interpreted the tooltip for IsEqual or it is in the wrong place. From the tooltip it looks like the ,8 for substring case insensitive gets placed in the field name box. Now I see what needs to be done.
Logged

MusicHawk

  • Citizen of the Universe
  • *****
  • Posts: 796
Re: Expression Help
« Reply #7 on: October 15, 2009, 11:34:59 am »

In addition to naming people in photos, I use the Keywords field to add further information.

One Keyword is "Family". So, by selecting this for appropriate photos, I can locate/list/view all photos that contain Family based on just this keyword -- I don't need to keep track of all the family member names in an expression.

In fact, I have a Smartlist view "Family" that lists everyone alphabetically, but since it selects on Keywords=Family it only includes those people/photos.

I use many other Keywords, such as Birthday, Holiday, Wedding, Home, Office, etc.

So, to see all Family photos of Birthdays, but no other photos, I just select on these two Keywords.

(Yes, Birthday could be an Event tag. I my library I use Event for more specific info, such as "Bubba's Birthday" so I can find all the photos of that.)

Logged
Managing my media with JRiver since Media Jukebox 8 (maybe earlier), currently use Media Center for Audio/Music and Photos/Videos.
My career in media spans Radio, TV, Print, Photography, Music, Film, Online, Live, Advertising, as producer, director, writer, performer, editor, engineer, executive, owner. An exhausting but amazing ride.

gappie

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4580
Re: Expression Help
« Reply #8 on: October 15, 2009, 11:36:50 am »

nice that it works.
i understand what you see, but the two 0 in the last values from the tooltip are for getting 'pure data' like with duration and dates. values that are stored differently from how you get them presented.
from the wiki:
Quote
After the field name, a comma can be placed followed by a 0 or 1 for whether the field should get formatted. So, [Duration] and [Duration, 1] will give "4:02" while [Duration, 0] will give "242".

 :)
gab
Logged

rick.ca

  • Citizen of the Universe
  • *****
  • Posts: 3729
Re: Expression Help
« Reply #9 on: October 15, 2009, 12:32:22 pm »

Have you considered using nested fields? I use nested Places, People and Keywords for photos, and it seems to work very well. The structure of my People category is, in part, Family\Individual, so I can easily select all photos that include any members, or any one member, of one family. I also use a collection of simple search lists to refine selections further. To restrict the selection to photos of the subject person alone, for example: -[People]=[] [=IsEqual([people],;,8)]=0. Using a pane view with these categories and the search lists (together in one pane), it's very easy to select photo of "Bob alone in the park with his dog," or "Bob AND Mary with any cat," etc.
Logged

SeaDrive

  • World Citizen
  • ***
  • Posts: 173
Re: Expression Help
« Reply #10 on: October 15, 2009, 12:46:50 pm »

rick.ca - I'll play around with that approach and see if it has any benefit for my library.

gappie - When I first tried your latest suggestion it worked great. Then when I added some new library fields it stopped working. It drove me crazy for a while. What I finally realized is that I needed to create the field as a list field (not calculated) I would then exit back to library view. Now I could go back and change the field type to calculated and add the code. If I didn't do this the field would behave like a simple text field. Does that make sense?
Logged

gappie

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4580
Re: Expression Help
« Reply #11 on: October 15, 2009, 01:25:51 pm »


gappie - When I first tried your latest suggestion it worked great. Then when I added some new library fields it stopped working. It drove me crazy for a while. What I finally realized is that I needed to create the field as a list field (not calculated) I would then exit back to library view. Now I could go back and change the field type to calculated and add the code. If I didn't do this the field would behave like a simple text field. Does that make sense?
now that would suprise me. until now a calculated field is always a plain text field, but by putting the &datatype= etc at the end, it behaves as a list field (more or less). the important thing, for when you missed that part, is the ; behind the names. you could also think about just do the calculation in the library field, and add the datatype as an expression at the place where you need it. or at least start that way.

 :)
gab
Logged

gappie

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4580
Re: Expression Help
« Reply #12 on: October 15, 2009, 01:28:35 pm »

Have you considered using nested fields? I use nested Places, People and Keywords for photos, and it seems to work very well. The structure of my People category is, in part, Family\Individual, so I can easily select all photos that include any members, or any one member, of one family. I also use a collection of simple search lists to refine selections further. To restrict the selection to photos of the subject person alone, for example: -[People]=[] [=IsEqual([people],;,8)]=0. Using a pane view with these categories and the search lists (together in one pane), it's very easy to select photo of "Bob alone in the park with his dog," or "Bob AND Mary with any cat," etc.
that is also how i did it. wih the nesting. but for the amount of persons i use a listcount. works nicely also, in a pane or in Theater View... there is much possible.
and fun

 :)
gab
Logged
Pages: [1]   Go Up