INTERACT FORUM

More => Old Versions => Media Center 15 (Development Ended) => Topic started by: mark_h on December 08, 2010, 03:35:46 am

Title: &datatype=[list] question
Post by: mark_h on December 08, 2010, 03:35:46 am
When using this construct to create expression trees, is it possible to parse the children nodes in any way?

Ex:  data is '1952\12\11\9; 1952\12\11\7' and I used the
Code: [Select]
&datatype=[list]
Title: Re: &datatype=[list] question
Post by: Vincent Kars on December 08, 2010, 05:42:33 am
Try ListItem[...]
http://wiki.jriver.com/index.php/Media_Center_expression_language
Title: Re: &datatype=[list] question
Post by: mark_h on December 08, 2010, 07:05:56 am
I have an unknown number of list items, which generate the tree...  I don't see how to use listitem() to know which node I am at in the tree...

Now, if there were a modifier to listitem() that would return the list entry of the current tree node that would be most helpful...

Title: Re: &datatype=[list] question
Post by: ProblemChild on December 08, 2010, 09:15:14 am
Though there are an unknown # of items, is there a max # length?
Could you break your list items into child fields, then use those to create your list?
ie instead of using &datatype on a single field, break it down into several pieces,
then create a nested view from that, and sort on the individual fields?
Title: Re: &datatype=[list] question
Post by: mark_h on December 08, 2010, 09:28:22 am
Though there are an unknown # of items, is there a max # length?
Could you break your list items into child fields, then use those to create your list?
ie instead of using &datatype on a single field, break it down into several pieces,
then create a nested view from that, and sort on the individual fields?


Fields are max length and delimited, but with potentially many such fields in a given entry

YYYY\MM\DD\N (where N is chart position, so could be 1-40)

So, an entry for one track could be:

[chart history]1952\11\15\1;1952\11\22\1;1952\11\29\1;1952\12\06\1;1952\12\13\1;1952\12\20\1;1952\12\27\1

And the next track could be:

[chart history]1952\11\15\2;1952\11\22\5;1952\11\29\2;1952\12\06\2;1952\12\13\2

Could you give an example of what you mean??

I've used the \ format for the fields as this allows MC to nest the data easily...

Cheers,

Mark

Title: Re: &datatype=[list] question
Post by: rick.ca on December 08, 2010, 02:30:22 pm
It seems that MC expressions parse the entire string and are unaware of each tree step?

I don't think this has anything to do with expressions. List fields are now ordered lists (as they should be, because order is often significant). You can sort the data in a field (using the edit mode context menu), but only one field at a time. What is the source of your chart data, and how are you importing it? Maybe you could sort the source, and re-import.
Title: Re: &datatype=[list] question
Post by: Vincent Kars on December 08, 2010, 03:12:40 pm
As the data  is sorted alphabetically a simple solution is to add leading space or 0
1952/01/02/001
Title: Re: &datatype=[list] question
Post by: mark_h on December 09, 2010, 01:48:38 am
The tree is sorted correctly.  It's the tracks listed in the pane for the selected tree node that are not.  I'll put together a couple of images to show what I mean...  If I click refresh, the track listings are updated randomly; what I want to do is somehow know what tree node I'm at and create a sort based on the data at that level - or at least have the tracks listed in the same order as the tree...  Adding leading zeros to the data WOULD work but only if I can extract the correct field data for the current tree node...
Title: Re: &datatype=[list] question
Post by: mark_h on December 09, 2010, 06:45:20 am
Ok, here's an image showing the problem.  The tree is absolutely fine; correctly sorted.  But the tracks in the panes are sorted randomly.  Here is a side by side - the only difference is I hit the refresh button and the track order changed.  What I'm trying to do is ensure that the tracks are sorted correctly as defined by the final child numbers in the each subtree, ie their chart position, which is defined in the data field

yyyy\mm\dd\pos

(http://farm6.static.flickr.com/5244/5246504106_f4355e638f_b_d.jpg)
Title: Re: &datatype=[list] question
Post by: ProblemChild on December 09, 2010, 10:35:19 am
no idea what I'm doing wrong we the img, but don't have time to mess w/it any more.
Maybe I'm just misunderstanding, but is this similar to what you want:
the tree showing import dates broken down by year/month/day, being able to sort by any of those in the view pane?

http://www.pix01.com/gallery/25E1AFEB-BBC4-41AB-8B3F-4BC0740C133E/prtscreen/bigpage.html?image=762666110_orig0.jpg (http://www.pix01.com/gallery/25E1AFEB-BBC4-41AB-8B3F-4BC0740C133E/prtscreen/bigpage.html?image=762666110_orig0.jpg)

Code: [Select]
[img]http://www.pix01.com/gallery/25E1AFEB-BBC4-41AB-8B3F-4BC0740C133E/prtscreen/bigpage.html?image=762666110_orig0.jpg[/img](http://www.pix01.com/gallery/25E1AFEB-BBC4-41AB-8B3F-4BC0740C133E/prtscreen/bigpage.html?image=762666110_orig0.jpg)
Title: Re: &datatype=[list] question
Post by: Matt on December 09, 2010, 10:47:55 am
I'm afraid you're over my head on this one.  If you had a single chart position, I think we could find a solution, but since you have a list of chart positions per file, it gets complex.

Sorry I'm not more help.
Title: Re: &datatype=[list] question
Post by: mark_h on December 09, 2010, 11:02:46 am
no idea what I'm doing wrong we the img, but don't have time to mess w/it any more.
Maybe I'm just misunderstanding, but is this similar to what you want:
the tree showing import dates broken down by year/month/day, being able to sort by any of those in the view pane?

http://www.pix01.com/gallery/25E1AFEB-BBC4-41AB-8B3F-4BC0740C133E/prtscreen/bigpage.html?image=762666110_orig0.jpg (http://www.pix01.com/gallery/25E1AFEB-BBC4-41AB-8B3F-4BC0740C133E/prtscreen/bigpage.html?image=762666110_orig0.jpg)

Code: [Select]
[img]http://www.pix01.com/gallery/25E1AFEB-BBC4-41AB-8B3F-4BC0740C133E/prtscreen/bigpage.html?image=762666110_orig0.jpg[/img](http://www.pix01.com/gallery/25E1AFEB-BBC4-41AB-8B3F-4BC0740C133E/prtscreen/bigpage.html?image=762666110_orig0.jpg)


Are your ImportYear,ImportMonth and Import Day columns expression fields?  Could I see the expression?

Cheers,

Mark
Title: Re: &datatype=[list] question
Post by: mark_h on December 09, 2010, 11:06:23 am
I'm afraid you're over my head on this one.  If you had a single chart position, I think we could find a solution, but since you have a list of chart positions per file, it gets complex.

Sorry I'm not more help.

Matt, thanks for the input.  I hope this little challenge now keeps you awake at night until you find a solution!  And I mean that in the friendliest, most respectful,  way! :D

So there's no way to simply tie the pane ordering to the tree?? (I guess not or you'd have said so).

Title: Re: &datatype=[list] question
Post by: ProblemChild on December 09, 2010, 03:18:38 pm
Sure, here's what they are in the view I posted:
Code: [Select]
[ImportMonth] = formatdate([date imported],0),MM)
[ImportYear] = formatdate([Date Imported,0],yyyy)
[ImportDay] =formatdate([Date Imported,0],dd)

[Imported] =[ImportYear]\[ImportMonth]\[ImportDay]&DataType=[List]

The view uses [Imported] for the category/tree, while the columns in the
view below show [ImportMonth], etc, though really they could be omitted and the
view could still use them for it's default sort pattern.

I know it's not quite the same, and maybe I'm just missing what you want, but with respect to
your question, I was wondering if you could do something like:

Code: [Select]
[field1] = listitem([yourstring],0,\)
[field2] = listitem([yourstring],1,\)
etc.

that's why I was wondering if you had a max # of possible fields. If your tree could only go to a max level
six deep, just have [field1] to [field6]. But I'm unclear whether what you then want to sort on is always
going to be, say, the nth-level field, or if you want to sort on "the last one." I wasn't sure from the image
where [chart weeks] came from. Is [chart weeks] always the 6th item, always 'the last item', or what's the
formula for determining it? ie If it comes from 'the last part of the string'- so for string one, [chart weeks] could
be the 5th item, yet for the next string it might be the sixth item, you would need to create another field,
[lastiteminstring], say, and use something like

Code: [Select]
[lastiteminstring]=right([yourstring],3).

Is this close to what you're looking for?






Title: Re: &datatype=[list] question
Post by: rick.ca on December 09, 2010, 07:10:16 pm
I'm afraid you're over my head on this one.  If you had a single chart position, I think we could find a solution, but since you have a list of chart positions per file, it gets complex.

Right. You'll have to add this one to the "R" file. ;D

Mark, I'm not sure how you want to use your chart data. I'm not even sure how I'd do it myself—if I had any. So I did this little experiment. I happen to have a Top 100 by Year chart, so I entered the top 10 for years 1980 to 1985. I used this format: Top 100\Year\Rank. Artist: Name to give the results in the screen shot. The data is in an Excel file, so it was easy to format it.

This chart data is fundamentally different than yours (songs can only be on one chart), so I cheated and put Pink Floyd: Another Brick in the Wall Part 2 on both the 1980 and 1981 charts. The point I'm illustrating is the actual charts can be shown in the pane by adding the name of the track to the chart position entry.
Title: Re: &datatype=[list] question
Post by: mark_h on December 10, 2010, 01:37:52 am
Rick, that would work!  Once I've populated my data I can export the dataset and write a PERL script to update my Position field to contain the track title.  Then I can create a view similar to yours.  The downside would be that the data is contained within the tree and would still not match the tracks in the pane if I were to show them, so I can not add value by displaying tracks and other interesting fields; I'd be restricted to just showing the tree...  Well, unless I'm happy to live with the random sorted tracks in the pane and the sorted tracks in the tree.

But it's a step in the right direction.  THANKS!

Rick, in fact, we're there.  I can use something like

replace([chart history],;, - [name];)

to put the data I want to display before the semicolon and then the tree expression does the rest.

AWESOME :D
Title: Re: &datatype=[list] question
Post by: mark_h on December 10, 2010, 01:41:58 am
that's why I was wondering if you had a max # of possible fields. If your tree could only go to a max level
six deep, just have [field1] to [field6]. But I'm unclear whether what you then want to sort on is always
going to be, say, the nth-level field, or if you want to sort on "the last one."

The problem is that the number of fields is unlimited, so whatever I do has to smart enough to pull the data I need from anywhere in the record.

Quote
I wasn't sure from the image
where [chart weeks] came from. Is [chart weeks] always the 6th item, always 'the last item', or what's the
formula for determining it? ie If it comes from 'the last part of the string'- so for string one, [chart weeks] could
be the 5th item, yet for the next string it might be the sixth item, you would need to create another field,

[chart weeks] is the count of entries in the [chart history] field

Somewhere in that list will be the highest position achieved; I'd also like to be able to pull that out from any list for display.

I suspect I'm going to have to dump the data into an mpl file and do some external processing and reimport, which is a shame, but as this is a dataset that doesn't change, it's not a big issue as I can do the processing once and the data is set.

Getting there!
Title: Re: &datatype=[list] question
Post by: mark_h on December 10, 2010, 04:02:49 am
Just need to continue populating data, and collecting the missing tracks...

(http://farm6.static.flickr.com/5006/5248798632_d073a1a14a_b_d.jpg)
Title: Re: &datatype=[list] question
Post by: ProblemChild on December 10, 2010, 11:17:13 am
ahhh, now I see. I think.
But using =listcount([Charts]) works fine for me, it sorts everything by the weeks, so maybe not.
If I still am missing something I'll drop it - just getting frustrated trying to learn from it myself so...

http://www.pix01.com/gallery/25E1AFEB-BBC4-41AB-8B3F-4BC0740C133E/anygallery/bigpage.html?image=542136364_orig0.jpg (http://www.pix01.com/gallery/25E1AFEB-BBC4-41AB-8B3F-4BC0740C133E/anygallery/bigpage.html?image=542136364_orig0.jpg)(http://www.pix01.com/gallery/25E1AFEB-BBC4-41AB-8B3F-4BC0740C133E/anygallery/bigpage.html?image=542136364_orig0.jpg)
Title: Re: &datatype=[list] question
Post by: mark_h on December 10, 2010, 01:36:58 pm
ahhh, now I see. I think.
But using =listcount([Charts]) works fine for me, it sorts everything by the weeks, so maybe not.
If I still am missing something I'll drop it - just getting frustrated trying to learn from it myself so...

http://www.pix01.com/gallery/25E1AFEB-BBC4-41AB-8B3F-4BC0740C133E/anygallery/bigpage.html?image=542136364_orig0.jpg (http://www.pix01.com/gallery/25E1AFEB-BBC4-41AB-8B3F-4BC0740C133E/anygallery/bigpage.html?image=542136364_orig0.jpg)(http://www.pix01.com/gallery/25E1AFEB-BBC4-41AB-8B3F-4BC0740C133E/anygallery/bigpage.html?image=542136364_orig0.jpg)


I'm looking to sort by the chart position, which can be one of many things.  Fortunately the tree is sorted correctly, but the track panes are sorted randomly.  I can see no way to pull a sort order from the data I am using.  But for now, the trick of adding the [name] and [artist] directly to the tree is working, as shown in my image.  I'm happy with that for now.

I've been working on the idea of this view for a year or so; it's only recently that MC has been able to support the first parts of it.  Hopefully in a year or two the missing pieces will be available :D
Title: Re: &datatype=[list] question
Post by: bostonmark on December 10, 2010, 02:45:00 pm
   -
Title: Re: &datatype=[list] question
Post by: mark_h on December 11, 2010, 07:23:31 am
Update.  Here's where I am currently:

(http://farm6.static.flickr.com/5246/5251452210_a42c841674_b_d.jpg)

I added the right side pane that shows the entire chart history for the selected track.

The biggest disappointment here, due to the files not being sorted to the same order as the tree, is that I cannot highlight a week, eg the tree node 30 in the image, and play the week's entire charts in chart order; they will currently play randomly.

I changed the format of the fields to:

yyyy\mm\dd>pos;

So that I could better format the track history, and I use replace() where necessary to build the tree and format the data.

How cool is JRiver Media Center?!