Mdx Using Regex For Name

May 27, 2008



I want to write a query which does something like 'get sales data in 2006 for products with names starting with "bond" '. My problem is writing mdx which can filter products names which contain certain word in a certain format and also output the matched product name.

In MDX, is it possible to filter dimension members using regex? If regex support is not available, is there sql 'like' operator in mdx.

Thanks,
Chandra.

View 3 Replies


ADVERTISEMENT

RegEx Problem

Apr 7, 2006

Can anyone tell me what is wrong with my regex plz:

Code:

Like "[A-Z][A-Z][0-9][0-9][0-9][A-Z][A-Z]" Or " [A-Z][A-Z][0-9][0-9][A-Z][A-Z]"



The Or condition seems to bust the whole thing, I tried And too but no go.
This works though:

Code:

Like "[A-Z][A-Z][0-9][0-9][0-9][A-Z][A-Z]"

View 1 Replies View Related

SQL Regex Replace How-To?

Feb 21, 2007

Anyone find any good readings on how to do a regular expression to replace text?

Basically trying to figure out how to replace text in columns (replace quotes " with the word inches. so 12" will be 12 inches)

View 5 Replies View Related

Regex In Mssql ?

Nov 20, 2007

hello people,
I have a table with some field named 'f1', the filed contains string like this:

1:3-12/23.2:3-23/12.78:4-12/11
and so on with the same format...

I need to write some sql query that extracts all the first one or two numbers that appears before the ':' (all the red numbers in the example above). I don't mind if I get the result as a set of rows or a string that contains all the (red) numbers.
is it possible with mssql?

thanks.

View 2 Replies View Related

Regex Task?

Apr 13, 2007

I have a field in my table that in my transformation I like to replace all characters except (letters,digits,space and hyphen) with "". Is it possible to do that in SSIS package and possibly though regex?



Thanks for your time in advance.



View 6 Replies View Related

Regex For Dtexec /ConsoleLog

Mar 12, 2008

This is a long shot but I'm hoping someone from the SSIS team can help.

Do you happen to have a regular expression that checks validity of the value supplied to the /ConsoleLog option of dtexec?

I suspect the answer is no but I thought I'd ask anyway. I figure you guys must have had to solve this at some point when you originally wrote dtexec.

Thanls
Jamie

[Microsoft follow-up]

View 3 Replies View Related

GPL RegEx Source Component

Apr 6, 2006

While working on a recent project, I needed to import a number of old mainframe generated text reports. Since they didn't work on the one-record/one-row construct, the Flat File Source won't work.

So, I created a custom component that allows you to specify a Regular Expression pattern, and it will parse a text file and return columns. Each capture in the RegEx pattern is returned as a column, and you can also specify column names in the regex with the standard (?<colname>) syntax. The code is fairly basic really, but if you are comfortable with regular expression syntax, it can handle a huge variety of unusual text file formats. It also includes a UI editor for the RegEx pattern property that will allow you to test the pattern against a sample text file; it will highlight each row in blue and each column in green (see screenshot)

Since this might have applications for other folks, I added it to SourceForge under GPL. So if you might find that functionality useful, please check out http://sourceforge.net/projects/textregexsource/ and send me some feedback. There isn't much there yet, so check out the screenshots/news/release notes for the basics.

If there is demand, I'll create a more robust install package and documentation. Also looking for feature suggestions.

Cheers...Geof

View 2 Replies View Related

Help With Query (control Structure &#043; Regex)

Mar 10, 2008

Hi,

I have the following query I am bulding, its returning the desired results I am just really bad at control statements in TSQL.

What I want to do is dynamically pass the "and landingPage like '/products%' to the SPROC. If I pass nothing this part of the query is not added.

Also, I am wondering how difficult it would be to pass some RegEx into the "landingpage like '%asdf' " part of the query ?
I have started reading some articles but it seems pretty complicated. I am running sql2005 so I am clear on that part.

Any help is much appreicated!!

Thanks again,
mike123




CREATE PROCEDURE [dbo].[select_google_referrers_groupByQueryDate_OrderByQueryDate]

(
@numDays int,
@landingPage varchar(50) = NULL
)

AS SET NOCOUNT ON

SELECT CONVERT(varchar(10),GO.queryDate,112) as referDate,

COUNT(GO.queryID) AS TotalReferrers FROM tblgoogle_referrerDetails GO

WHERE DateDiff(dd, GO.queryDate, GetDate()) < @numDays and landingpage like '/products%'

GROUP BY CONVERT(varchar(10),GO.queryDate,112)

ORDER BY referDate DESC
GO

View 11 Replies View Related

Regex Parser Text Field

Jul 20, 2005

I have a text field that contains abstract information formated inHTML, I'd like strip the HTML and insert the data in another Textfield within a DTS package. Is this possible?any suggestions would be appreciatedMatt

View 1 Replies View Related

Transact SQL :: How To Make Phone Number In A Regex Pattern

Oct 27, 2015

I am learning the string functions and the database that I'm using is AdventureWorks2012.However ,while practicing I was just trying to hide the phone number with '*' mark,but not getting the desired result.So the code is.............

SELECT
             PhoneNumber,  (SUBSTRING(PhoneNumber,1,2)+REPLICATE('*',8)+
             SUBSTRING(PhoneNumber,CHARINDEX('[0-9][0-9]{1,2}',PhoneNumber),LEN('-555-01')))AS[PhoneNumber]
 FROM
             Person.PersonPhone

[code]....

View 6 Replies View Related

Simple Text Processing E.g. Regex Search And Replace

Aug 8, 2006

I've got an nvarchar(max) column that I need to transform with some simple text processing: insert some markup at the very beginning, and insert some markup just before a particular regular expression is matched (or at the end, if no match is found).

Since the SSIS expression language doesn't support anything like this, is a Script Component the only way to go? Does Visual Basic .NET provide regular expression matching?

Thanks!

View 13 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved