Matching lists with placeholders

I’ve got a graph creating a list of lists that I need in the same order. They might look like this;

{Tag, GAs,Txt} – good
{Tag, GAs,Txt} – good
{Tag,GAs} – need to add Txt to index 2
{GAs,Txt} – need to add Tag to index 0
{Tag} – need to add GAs to index 1, and Txt to index 2
{Txt} – need to add Tag to index 0, and GAs to index 1
{GAs} – need to add Tag to index 0, and Txt to index 2
{Tag,Txt} – need to add GAs to index 1

I’ve tried a number of ways (too many to show) and none of them are working just yet. Thoughts?

Do you mean that ??

As written, you want to end up with a list of lists, all of which look like {Tag, GAs, Txt}?

But I guess your list elements aren’t just text: {“Tag”, “GAs”, “Txt”}? If they were, there’s a trivial solution. just Count the input list and then OfRepeatedItem your desired sublist.

So I think the solution has to depend on what kind of elements they are.

I over simplified in my first post. I’m not used to writing lists like this. A better version;

{{Tag 5},{GAs 14},{Txt 23}} – good
{{Tag 25},{GAs 3},{Txt 5}} – good
{{Tag 34},{GAs 32}} – add {Txt 0} at index 2
{{Tag 26},{Txt 12}} – add {GAs 0} at index 1
{{GAs 6}} – add {Tag 0} at index 0, add {Txt 0} at index 2

Prior to this point I’ve extracted the number of tags, GAs, and text notes from each view and concatenated them. Not all views have all 3 types so they way I’ve done this so far gives them in this order. I don’t need them to be concatenated but it was the only way I could find to understand the order. Adding the Tag 0, etc is a placeholder so they’ll all sort correctly down stream in a CSV or Excel.

I’ve attached the DYN that works but gets them out of order. Forewarned, this thing kills my RAM on a test model.


Greg McDowell Jr

Annotation Quantification byView.dyn (44.4 KB)

Yes, that makes sense. Thanks.

Is the ‘Element in View on Sheet’ node from a public Package? It looks as though it’s designed to find the sheet that a given element is on?

Would it work if you made a list of Unique Views, and collated your metrics against that, immediately after you do the Count:

This way, you have valid counts (or zero) for each category for each view, and the sorting and formatting thereafter becomes easier.

I’ll attach the dyn in case it helps: It’s a really hacky version of yours so please excuse the mess. You could obviously simplify the collation nodes: I’ve just replicated the group three times for the three categories, but it should be possible to make that much more elegant. And I wasn’t sure what you were doing later on, so I just stopped after making the collated lists…Hope I’ve understood what you were trying to do, and HTH of course!

Annotation Quantification byView_DW.dyn (62.1 KB)

Sorry, that nodes is a custom node that I haven’t published. Forgot it was in there.

Thanks for the help. I was thinking I needed a new approach. The output looks right. I’ll let you know how it works in a project.

Works like a champ. Thanks!