[tw5] Re: Tricky Filter Question

2021-02-15 Thread Charlie Veniot
Just using pseudocode to understand the process:

bCount = the number of entries in B
aCount = the number of entries in A *minus 1* (i.e. minus the last entry 
which the process always leaves as is, so the last one is ignored)
aLastEntry = the last entry 
Result will be the final list

LoopRangeEnd = aCount


Loop, setting nIndex from 1 to LoopRangeEnd *(in steps of 1)*
If item nIndex from A exists in B
  Then add item nIndex from A to Result
Otherwise 
 If nIndex > bCount
   Then add the last item from A to Result
 Otherwise
Then add item nIndex from B to result

<-- after the main process, tack on the last entry from A -->
Finally, add the last item from A to result

Let me know if that makes sense.  If it does, I think I can do that.
On Monday, February 15, 2021 at 5:11:56 AM UTC-4 scourfie...@gmail.com 
wrote:

> Ideally "Alternative" would just be overriden by Delta, since it doesn't 
> appear in List B
> On Monday, 15 February 2021 at 03:26:34 UTC cj.v...@gmail.com wrote:
>
>> Silly question:  If A was : Alpha Beta Alternative Delta, and B was still 
>> "Alpha Gamma", what should the final result be?
>>
>> On Sunday, February 14, 2021 at 8:25:57 AM UTC-4 scourfie...@gmail.com 
>> wrote:
>>
>>> Hey all
>>>
>>> I've got a situation where I have two lists. List A and List B. I've 
>>> specified some dummy info below:
>>>
>>> *A: *Alpha Beta Gamma Delta
>>> *B **(this will change by user input, but for this example:) *Alpha 
>>> Gamma
>>>
>>> I want to write a filter to apply to List A where if any item does not 
>>> also appear on List B (i.e. in this case Beta and Delta are missing), it is 
>>> overwritten by the immediately subsequent value in List A, except the very 
>>> last item in List A which is remains in place to act as a default value if 
>>> no subsequent value can be found.
>>>
>>> So in this example the filtered version of List A would output as: *Alpha 
>>> Gamma Gamma Delta*, because Beta was not present in List B so it is 
>>> replaced by the next value of Gamma, and Delta remains because it is at the 
>>> very end.
>>>
>>> My question is, is there a way to do this with a static filter 
>>> expression? I'm sure I could make something with action-listops widgets 
>>> that would do the job when they were activated, but ideally I want 
>>> something that updates automatically whenever the user changes List B.
>>>
>>> Any help anyone could provide would be much appreciated.
>>>
>>> Thanks
>>> Joseph
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/79e4098f-9095-4cae-9689-7b87c8e1252dn%40googlegroups.com.


[tw5] Re: Tricky Filter Question

2021-02-15 Thread scourfie...@gmail.com
Ideally "Alternative" would just be overriden by Delta, since it doesn't 
appear in List B
On Monday, 15 February 2021 at 03:26:34 UTC cj.v...@gmail.com wrote:

> Silly question:  If A was : Alpha Beta Alternative Delta, and B was still 
> "Alpha Gamma", what should the final result be?
>
> On Sunday, February 14, 2021 at 8:25:57 AM UTC-4 scourfie...@gmail.com 
> wrote:
>
>> Hey all
>>
>> I've got a situation where I have two lists. List A and List B. I've 
>> specified some dummy info below:
>>
>> *A: *Alpha Beta Gamma Delta
>> *B **(this will change by user input, but for this example:) *Alpha Gamma
>>
>> I want to write a filter to apply to List A where if any item does not 
>> also appear on List B (i.e. in this case Beta and Delta are missing), it is 
>> overwritten by the immediately subsequent value in List A, except the very 
>> last item in List A which is remains in place to act as a default value if 
>> no subsequent value can be found.
>>
>> So in this example the filtered version of List A would output as: *Alpha 
>> Gamma Gamma Delta*, because Beta was not present in List B so it is 
>> replaced by the next value of Gamma, and Delta remains because it is at the 
>> very end.
>>
>> My question is, is there a way to do this with a static filter 
>> expression? I'm sure I could make something with action-listops widgets 
>> that would do the job when they were activated, but ideally I want 
>> something that updates automatically whenever the user changes List B.
>>
>> Any help anyone could provide would be much appreciated.
>>
>> Thanks
>> Joseph
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/1a9d0297-c320-4dee-a770-01baed366da6n%40googlegroups.com.


[tw5] Re: Tricky Filter Question

2021-02-14 Thread Charlie Veniot
Silly question:  If A was : Alpha Beta Alternative Delta, and B was still 
"Alpha Gamma", what should the final result be?

On Sunday, February 14, 2021 at 8:25:57 AM UTC-4 scourfie...@gmail.com 
wrote:

> Hey all
>
> I've got a situation where I have two lists. List A and List B. I've 
> specified some dummy info below:
>
> *A: *Alpha Beta Gamma Delta
> *B **(this will change by user input, but for this example:) *Alpha Gamma
>
> I want to write a filter to apply to List A where if any item does not 
> also appear on List B (i.e. in this case Beta and Delta are missing), it is 
> overwritten by the immediately subsequent value in List A, except the very 
> last item in List A which is remains in place to act as a default value if 
> no subsequent value can be found.
>
> So in this example the filtered version of List A would output as: *Alpha 
> Gamma Gamma Delta*, because Beta was not present in List B so it is 
> replaced by the next value of Gamma, and Delta remains because it is at the 
> very end.
>
> My question is, is there a way to do this with a static filter expression? 
> I'm sure I could make something with action-listops widgets that would do 
> the job when they were activated, but ideally I want something that updates 
> automatically whenever the user changes List B.
>
> Any help anyone could provide would be much appreciated.
>
> Thanks
> Joseph
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/468dd8da-2cb5-400c-9b92-9da9e633c708n%40googlegroups.com.