Filter URL in GA regex for Custom IDs - google-analytics-filters

Looking to clear up some pages with IDs having trouble matching the ID in a middle of a URL.
Looking for some regex so I can do a find and replace so I can
Any help appreciated some examples are
www.abc.net/Alpha/Bravo/Delta/17986016/Kappa
www.abc.net/Alpha/Bravo/Delta/17982038/Kappa
www.abc.net/Alpha/Bravo/Delta/17870320/Kappa
www.abc.net/Alpha/Bravo/Delta/18982038/Kappa/?action=back
Note alpha, bravo and delta are static but Kappa is dynamic.
The ID changes but is 8 character long.
Would like to finish with:
www.abc.net/Alpha/Bravo/Delta/Kappa

A search and replace filter won't work for this as there is a variable (Kappa) in the RequestURI and the replace field in the filter requires a string.
A custom advanced filter will work though
By default GA only reports the RequestURI portion of a url in the reports. Are there any filters already applied that change the default reporting behaviour so that the Hostname is prepended to the RequestURI?
Assuming there are no filters already in play... and that the query parameter is also not a variable...
Filter Type > Custom Advanced
Field A -> Extract A
RequestURI ^(/Alpha/Bravo/Delta/)\d{8}\/(\w+)(\/\?action\=back)?
Field B -> Extract B
Leave blank
Output To -> Constructor
RequestURI $A1$A2
If there is a filter in place that prepends the Hostname to the RequestURI, then try the following instead and make sure this filter is placed lower in the filter order, after any other filters that change the default page reporting behaviour.
Filter Type > Custom Advanced
Field A -> Extract A
RequestURI ^(www.abc.net/Alpha/Bravo/Delta/)\d{8}\/(\w+)(\/\?action\=back)?
Field B -> Extract B
Leave blank
Output To -> Constructor
RequestURI $A1$A2

Related

How to do - wildcard search in Data Catalog (Google Cloud Platform)

How to execute a wildcard/RegEx search in Data Catalog (Google Cloud Platform) ?
It would make sense to search metadata across column names and tag attributes (and there values).
The current documentation only lists very strict search behavior
e.g. for tag:data_gov_template.hasPII(=true)
Needed would be a result for "PII" - I don't care about specifying the exact template name etc.
e.g. labels:etl
if I only search for etl there is no result
(metadata/attributes and values is not searchable on a direct way?)
From your use case, I understood that you want to search for a particular metadata attribute, like a Tag field, PII, right?
For tagged assets
If you don't care about the template name. You could use the tag:x search facet.
So if all your templates, data_gov_template, data_curator_template, data_etl_template, all contain the same Tag field name, has_pii, you can search using:
tag:has_pii and this will return all assets with that metadata attribute, no matter what the template name is.
For columns
You can use the column:x search facet to match a substring of the column name in the schema of the data asset. Which does not support nested columns yet.
For labels
You can use the labels:bar search facet for data assets that have a label (with some value) and the label key has bar as a substring.
You are also able to search on their values. So yes, the metadata/attributes and values are searchable.
But it is not a regex kind, it is a substring match when the search facet uses colon :, like labels:bar or an exact match when the search facet uses equals =, like type=table.

How to eval a field name contained in another field in an Access Query?

I need to create a long list of complex strings, containing the data of different fields in different places to create explanatory reports.
The only way I conceived, in Access 2010, is to save text parts in a table, together with field names to be used to compose the string to be shown (see line1 expression in figure). Briefly:
//field A contain a string with a field name:
A = "[Quantity]"
//query expression:
=EVAL(A)
//return error instead the number contained in field [Quantity], present in the query dataset
I thought doing an EVAL on a field (A), to obtain the value of the field (B) which name is contained in field A. But seems not working.
Any way exist?
Example (very simplified):
Sample query that EVAL a field containing other field names to obtain the value of the fields
Any Idea?
PS: Sorry for my english, not my mothertongue.
I found a interesting workaround in another forum.
Other people had same problem using EVAL, but found that it is possible to substitute a string with a field contents using REPLACE function.
REPLACE("The value of field Quantity is {Quantity}";"{Quantity}";[Quantity])
( {} are used only for clarity, not needed if one knows that words to be substituted do not compare in the string). Using this code in a query, and nesting as many REPLACE as many different fields one want to use:
REPLACE(REPLACE("<Salutation> <Name>";"<Salutation>";[Salutation]);"<Name>";[Name])
it is possible to embed fields name in a string and substitute them with the current value of that field in a query. Of course the latter example can be done more simply with a concatenation (&), but if the string is contained in a field instead that hardcoded, it can be linked to records as needed.
REPLACE(REPLACE([DescriptiveString];"[Salutation]";[Salutation]);"[Name]";[Name])
Moreover, it is possibile to create complex strings context-based as:
REPLACE(REPLACE(REPLACE("{Salutation} {Name} {MaidenName}";"{Salutation}";[Salutation]);"{Name}";[Name]);"{MaidenName}";IIF(Isnull([MaidenName]);"";[MaidenName]))
The hard part is to enumerate all the field's placeholders one wants to insert in the string (like {Quantity},{Salutation}, {Name}, {MaidenName}) in the REPLACE call, while with EVAL one would avoid this boring part, if only it was working.
Not as neat as I would, but works.

lucene filter: FieldCacheTermsFilter doesnot support space and special characters

I am using FieldCacheTermsFilter to filter out the results matching the field value as below.
Filter filter = new FieldCacheTermsFilter("city","toronto");
This works perfectly fine, whereas it doesn't work if the value has a space or special character in between like below.
Filter filter = new FieldCacheTermsFilter("city","new york");
Filter filter = new FieldCacheTermsFilter("type","b&b");
Is there way I can achieve this with any other filter.
PS: I am using FieldCacheTermsFilter for the reason that i want to search exactly on the word matching just "toronto" and not "greater toronto". I tried using TermFilter which extracts all the records containing toronto.
Your problem isn't the TermsFilter, it's your analyzer. Analysis should suit your needs for the field.
If you need to get exact matches on a whole field, you should index it as a StringField (or use KeywordAnalyzer, or set the field as untokenized). If you index with StandardAnalyzer, there is simply no good way to do what you are asking.

SPD: calculated column with data from another list

I'm in the same situation described HERE.
I'm trying to use Create List Item and Update List Item actions (like suggested in the answer) but without any results.
Could someone kindly explain the procedure mentioned in the answer?
Thank you,
Marcello
I posted an answer there, but here is a copy in case it gets deleted or removed:
lem.mallari's answer is a huge pain unless you can assume that the Amounts in List A never change, since it's not tracking whether an item has already been added to the sum. There is no way for a Workflow to iterate through a SharePoint list, which means there is no easy way to calculate the sum or average of multiple list items.
The correct way to implement this will will require some development. The SharePoint Developer Training (2010, 2013) will actually get you most of the way there: an event receiver should trigger when items are added or changed in Lists A and B that uses SharePoint's API to go through List A and average values by Name, then update all (or just affected) items in List B. Alternatively, you can use JavaScript to display the sum of all entries in List A that have the same name as the item in List B as long as all the data is displayed on your page. If you're handy with XPath and InfoPath, you could add List A as a secondary data source to List B's form and select only applicable items in List A to sum from.
But if we're talking Workflows, here's the "workflow only" method. This was tested and successful in 2010. Create custom List C with the following columns:
Title (string, mandatory, enforce unique values)
TotalItems (integer, mandatory, default 0)
Sum (number, decimal places however you want, mandatory, default 0)
Average (calculated, =IF(TotalItems=0,0,Sum/TotalItems)) (optional)
Replace the Name columns in Lists A and B with lookup columns pointing at List C. Delete the Amount column in List B, instead including the Sum column as an additional column. Add the following columns to List A, and ensure that users cannot change them directly. This can be restricted by making InfoPath forms or by making alternative view and edit forms.
AmountArchive (number, identical to Amount, default 0)
AmountHasBeenSubmitted (yes/no, default no)
Create a Workflow to run each time an item is created or modified in List A. Use these commands (I'm using a list for readability; it was getting ugly when formatted as code):
If Current Item:Amount not equals Current Item:AmountArchive
Set Variable:Item Count to (Data source: List C; Field from source: TotalItems; Find the List Item: Field Title; Value: Current Item:Name(Return field as: Lookup Value (as Text)))
Calculate Variable:ItemCount plus 1 (Output to Variable: ItemCount)
Calculate List C:Sum (similar settings as above; be sure to use Lookup Value (as Text) and not String!) minus Current Item:AmountArchive (Output to Variable: SumWithoutValue)
Calculate Variable: SumWithoutValue plus Current Item:Amount (Output to Variable: NewSum)
If Current Item:AmountHasBeenSubmitted equals No
Set AmountHasBeenSubmitted to Yes
Update item in List C (Set TotalItems to Variable:ItemCount; Set Sum to Variable:NewSum; Find the List Item in the same way of Field:Title; Value: Current Item:Name(Return field as: Lookup Value (as Text))
Else
Update item in List C (don't do anything to TotalItems; use the same logic to set Sum to Variable:NewSum)
Set Amount to Current Item:AmountArchive

concatenating string to solr field value while searching?

is it possible to concatenate string to solr field while we are searching
Example:
localhost:8983/solr/collection1/select?q=item_type%3Apostings&wt=json&indent=true
now i have one field id i need to append text "locality_" before every id value.so that i need not to to for loop on large data set.
With Solr 4.0 SOLR-2444 enables to define alias to a field, apply transformer to the value.
I have not used the above, but you can surely explore on the above either by modifying the value with function query add with constant value or defining a Custom Transformer to apply on a alias field.

Resources