Which element does the yahoo pipes "unique" module return - unique

If there are multiple matching elements, which element does the yahoo pipes "unique" module return? Is it the first, the last or can it be any?

From the docs:
This module removes items that contain duplicate strings. You select the element to filter on, and Unique removes the duplicates - if the original feed has five items with the same title, you can configure Unique so only one of these items is included in the output feed.
It would seem unspecified. However, after a couple of tests, it seems to me that the first item is selected. So you should be able to get the right items selected by using a Sort operator before Unique.
To illustrate this, I created 2 example pipes. In both pipes there are 3 input items with attributes:
author=jack title=Bazaar
author=jack title=Git
author=jack title=Arch
In the first pipe, using the Unique operator selects the first item. If you delete the first item, it selects the second.
In the second pipe, I used the Sort operator to order the items by title before piping to Unique. This way Arch is selected. If you delete it, then Bazaar is selected, and so on.

Related

Is there a way to use an MS Access multiselect listbox control to filter records WITHOUT using VBA or iterating through the selected values?

I think the question speaks for itself, but I'll use a trivial example. Consider a table of salespeople as shown below:
Now consider a simple search/filter form with a list box where the user selects a region and it lists the salespeople in that region:
This is trivial. Assuming the list box is named lstRegionFilter, the query used to build the subform is simply:
select
[tblSalespeople].[SalespersonName] as [Salesperson Name],
[tblSalespeople].[Region] as [Region]
from
tblSalespeople
where
[tblSalespeople].[Region] = [forms]![frmSearchForm]![listRegionFilter];
Now consider the list box is changed to a multiselection list box, so that the user can select multiple regions with the filter working accordingly, as follows:
While this can be done, every solution I've found involves a VBA procedure that iterates over the list box's selected items, constructs a comma-separated string, and feeds this string to the result query. This strikes me as being more work than ought to be necessary, and I figure I'm missing a simpler "built-in" solution, that ought to look something like this:
... where [tblSalespeople].[Region] in ([forms]![frmSearchForm]![listRegionFilter]);
or perhaps
... where [tblSalespeople].[Region] in (select * from [forms]![frmSearchForm]![listRegionFilter]);
The reason I figure there must be a simpler solution is because using a multi-selection list box to filter records would seem to be the most obvious purpose for the very existence of the multi-selection list box control in the first place. As such, it intuitively seems that there would need to be a built-in way of extracting the list box's selected values directly as a record-set-style object that would be natively understood by an Access query.
So, to make a long story short, my question is this:
Is there a simple built-in way to do this without writing code to iterate over the list box's selected items?

Extracting Text from one cell

I am collecting requests for inventory items as text from a google form using the checkbox control. When multiple items are selected, I end up with multiple text strings separated by a comma in one cell. I need to be able to fulfill the inventory items requested and I want to parse out each text phrase so I can match it to my items, fulfill the request and update the inventory as gone.
I have a sheet with inventory items, concatenated to the text strings as items, updated the form checkbox values to present to the user and collect the form responses. I need to be able to parse out when multiple choices are made, the response so I can match it to my inventory catalog, pick/pack it, and mark it off the list as fulfilled.
I'm using QUERY against my responses to pull out the date/time stamp as the key column, and the items selected as my text column. I think I need a custom function (or run a a script) to parse out the items and return the index/row number of text back on my catalog sheet. I'm just stuck on parsing out the multiple text blocks out of one cell.
like james say, you need to split content, from app script you need.
1_getRange of content.
2_use youRange.splitTextToColumns(',')
3_get new Range .
good luck
It sounds like SPLIT might do the job for you: https://support.google.com/docs/answer/3094136?hl=en
It can separate text from one cell into an array of cells based on a delimiter of your choice. However, keep in mind that it might falsely split your items in half if any of them also have a comma in their name.

How do I tie a selected item in a list box to a query (MS Access)?

I have a couple of list boxes on a form that I've created. One of the listboxes has a bunch of supplier names (lst_SupplierName). Upon selecting a supplier name it then auto-populates all Part Numbers under that supplier in another list box (lst_PartNumber).
I would like to take it a step further. So The Part Number listbox is now populating I would like to select a part number and based on that part number be able to create a query that lists all required attributes associated with that part number from the table it's contained in.
Make 2 lists, first one that queries supplier table, second one that queries part table that will use value of first list to query parts only for that supplier. Here is sample tables I created:
And form:
The first list row source is:
SELECT [tblSuplier].[SupID], [tblSuplier].[SupName] FROM tblSuplier ORDER BY [SupName];
Second list row source is:
SELECT tblPart.PartID, tblPart.SupID, tblPart.PartName, tblPart.PartDescr FROM tblPart WHERE (((tblPart.SupID)=[Forms]![frmMain]![lstSup]));
To make second list update, when you select something in first list, you need to add 'after update' event on first list:
Private Sub lstSup_AfterUpdate()
lstPart.Requery
End Sub
Now, you can use after update event to populate different fields on form from parts list the same way - by simply placing value into fields, like txtDescription = lstPart.column(2=3) .
If you have any questions, please let me know.

Magento - change multiselect semantics from "or" to "and"

When more than one value of a multiselect is used as a filter on a catalog or catalogsearch page in Magento, the multiple values are or'd together - i.e. the result is the union of the products that have any of these attributes.
How would I get the intersection of the sets of products with the selected attributes - i.e. only those products that have all of the selected attributes?
In the standard behavior of Magento you can only filter for one value like Lucasmus already indicated.
So you seem to be using some customization or module which edits the behavior of the core/Mage/Catalog/Model/Layer/Filter/Attribute.php model.
Also the class Mage_Catalog_Model_Resource_Eav_Mysql4_Layer_Filter_Attribute has to be rewritten, this is exactly the class where you could change the behavior you asked for.
In that class, the method
applyFilterToCollection($filter,$value)
creates the corresponding SQL code to do the filtering.
Currently your module or extension probably uses an OR notation, or uses something like
$connection->quoteInto("{$tableAlias}.value IN (?)", $value),
so it searches for any of your to be filtered values.
To achieve an AND, you will have to rewrite this method by splitting the $value into its distinct parts and using a where clause for each of the individual values.
Hope that makes sense.

Again, Flex 4, Actionscript Complex data filtering of XMLList filter and data-sets with special conditions

So I tried to format this properly the first time, but it published and all the stuff in carets wasn't parsed properly, so I'll try again:
I have been trying to decide what the best way to filter a set of data for a tree view is.
The filters are in the following XML format: using periods instead of carots
Filtering two datasets: .
AND
Basically the filters either include something from the full dataset into the result set or exclude, plus the special conditions below.
So I've been thinking about writing special conditions for the following, which are required at times because some of the data in a SpecificItem attribute-"" is coma delimited
condition (when critieria has to be evaluated as indexOf()) condition (when criteria applies to a SuperCat) condition (when multiple filters of same category, include expands) condition (when multiple categories being filtered, include narrows)
How can I write a simple function without multiple cases that meets these special conditions, and does typical standard filtering, loops through the multiple data sets to filter.
I've already written out a bunch of specific cases that make this all possible, but I feel like there should be a much simpler, better, and maybe more correct way to do this.
Ya it looks like the XML isn't parsing.... at all, so here it is without carets but indented
So I tried to format this properly the first time, but it published and all the stuff in carets wasn't parsed properly, so I'll try again:
I have been trying to decide what the best way to filter a set of data for a tree view is.
The filters are in the following XML format: using periods instead of carots
Category
FilterCategory(sometimes) FilterAgainstAttribute, FilterDataToCompare, FilterCategory
Filter Attributes(FilterAgainstAttribute, FilterDataToCompare, FilterCategory /
/FilterCategory(sometimes) /Category>
Filtering two datasets: .
SuperCategory Attributes
SubCategory Attributes
SpecificItem Attributes
AND
SuperCategory Attributes
SpecificItem Attributes