INTERACT FORUM

Please login or register.

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

Author Topic: &datatype=[list] question  (Read 5993 times)

mark_h

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1855
&datatype=[list] question
« 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]
    to create an expression tree:

    1952
    __12
    ____11
    ______9
    ______7

    Is it possible to work with the children nodes, for example, even though the final branch is sorted numerically, the parent node, in this case, 11, presents the data sorted alphabetically; there seems to be no way to sort on the children data or even parse the node so that sort method can be created.

    It seems that MC expressions parse the entire string and are unaware of each tree step?  What I need is a way to parse each child node, whatever the data - eg I might want to present the months as names instead of numbers...

    Cheers,

    Mark
Logged

Vincent Kars

  • Citizen of the Universe
  • *****
  • Posts: 1154
Re: &datatype=[list] question
« Reply #1 on: December 08, 2010, 05:42:33 am »

Logged

mark_h

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1855
Re: &datatype=[list] question
« Reply #2 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...

Logged

ProblemChild

  • Junior Woodchuck
  • **
  • Posts: 97
  • But I don't wanna be the same as everybody else...
Re: &datatype=[list] question
« Reply #3 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?
Logged

mark_h

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1855
Re: &datatype=[list] question
« Reply #4 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

Logged

rick.ca

  • Citizen of the Universe
  • *****
  • Posts: 3729
Re: &datatype=[list] question
« Reply #5 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.
Logged

Vincent Kars

  • Citizen of the Universe
  • *****
  • Posts: 1154
Re: &datatype=[list] question
« Reply #6 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
Logged

mark_h

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1855
Re: &datatype=[list] question
« Reply #7 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...
Logged

mark_h

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1855
Re: &datatype=[list] question
« Reply #8 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

Logged

ProblemChild

  • Junior Woodchuck
  • **
  • Posts: 97
  • But I don't wanna be the same as everybody else...
Re: &datatype=[list] question
« Reply #9 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

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

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42444
  • Shoes gone again!
Re: &datatype=[list] question
« Reply #10 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.
Logged
Matt Ashland, JRiver Media Center

mark_h

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1855
Re: &datatype=[list] question
« Reply #11 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

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


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

Cheers,

Mark
Logged

mark_h

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1855
Re: &datatype=[list] question
« Reply #12 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).

Logged

ProblemChild

  • Junior Woodchuck
  • **
  • Posts: 97
  • But I don't wanna be the same as everybody else...
Re: &datatype=[list] question
« Reply #13 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?






Logged

rick.ca

  • Citizen of the Universe
  • *****
  • Posts: 3729
Re: &datatype=[list] question
« Reply #14 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.
Logged

mark_h

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1855
Re: &datatype=[list] question
« Reply #15 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
Logged

mark_h

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1855
Re: &datatype=[list] question
« Reply #16 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!
Logged

mark_h

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1855
Re: &datatype=[list] question
« Reply #17 on: December 10, 2010, 04:02:49 am »

Just need to continue populating data, and collecting the missing tracks...

Logged

ProblemChild

  • Junior Woodchuck
  • **
  • Posts: 97
  • But I don't wanna be the same as everybody else...
Re: &datatype=[list] question
« Reply #18 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
Logged

mark_h

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1855
Re: &datatype=[list] question
« Reply #19 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


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
Logged

bostonmark

  • Member
  • *
  • Posts: 1
Re: &datatype=[list] question
« Reply #20 on: December 10, 2010, 02:45:00 pm »

   -
Logged

mark_h

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1855
Re: &datatype=[list] question
« Reply #21 on: December 11, 2010, 07:23:31 am »

Update.  Here's where I am currently:



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?!
Logged
Pages: [1]   Go Up