Archive for September, 2007

Grrr argghhhh! PHP consistency

Sunday, September 16th, 2007

I really really hope that PHP6 is going to be more consistent than PHP5.

Who the hell would write a function called html_entity_decode and then call it’s opposite function htmlentities (that’s aside from the fact about why you wouldn’t just call them html_decode and html_encode without the entities bit)?

PHP needs to sort these crappy bits out as it’s seriously annoying. If it’s not the stupid argument conventions (is it haystack then needle or vice-versa?) then it’s the inconsistent use of the underscore in functions.
What PHP needs is a benevolent dictator for life (BDFL) like Python gets with Guido - somebody with a good indepth view of languages but has used the language in anger on big websites.

Python3000 is coming out soon and that language is going to be (as usual) super clean and slick - if PHP’s not careful then Python will pick up its marketshare. The only reason i think that people use PHP over Python is support from ISPs, and the theory that Python’s more “academic” and harder to learn/use… but that’ll change.
I like PHP - it’s a tool that gets things done but it needs to improve and fast.

Helping Tune SSAS2005 OLAP Cubes

Thursday, September 13th, 2007

Today i was pointed at a good summary for optimising SSAS2005 cubes

In tandem you can use the “shared source” Visual Studio plugin - BIDS for more fine control of SSAS2005 - although use it with care if you don’t know what you’re doing!

OLAP MDX Optimisation Tip

Wednesday, September 12th, 2007

Ok Ok I know this is trivial but it’s saved more than my own bacon before…

You’ve built an OLAP (SSAS2005) Cube (and this isn’t your normal job) and some brain box has asked for a calculated member to be available (or alternately you’re adding this as a calc. member to a report and you want it calculated on the fly - see below it’s basically identical)

For example you want to find the ratio of the current bank accounts balance relative to all the others so you add a member of the ilk (in script form this is);

CREATE MEMBER CURRENTCUBE.[MEASURES].[Ratio of Account Balance]
AS iif ( IsEmpty( [Measures].[Account Balance] ),
[Measures].[Account Balance],
( [Measures].[Account Balance] ) / ( ROOT([Account]), [Measures].[Account Balance] )
),
VISIBLE = 1 ;

So, you run the cube in a report or the browser and suddenly that lovely cube response has shot up from sub-10 seconds to never coming back… what could you have done?

Well i’m assuming you’ve got a lot of data ™ - probably hundreds of millions of fact rows and you’ve now stopped SSAS optimising the search path and ignoring the empty bits. So, give it a hint and add the NON EMPTY BEHAVIOR (sic - behaviour - that gets me every time - colour becoming color i get but behaviour is just wrong) tip.

In the GUI simply select the requisite measure field, in the script tab add
NON_EMPTY_BEHAVIOR = { [Account Balance] }

voila! instant speed up and less heart attack!

(note: if this was an inline calc-on-the-fly type member then the full wording would be…

WITH MEMBER CURRENTCUBE.[MEASURES].[Ratio of Account Balance]
AS iif ( IsEmpty( [Measures].[Account Balance] ),
[Measures].[Account Balance],
( [Measures].[Account Balance] ) / ( ROOT([Account]), [Measures].[Account Balance] )
),
NON_EMPTY_BEHAVIOR = { [Account Balance] },
VISIBLE = 1 ;

SQL Server Reporting Services - doing custom subtotals

Wednesday, September 12th, 2007

Chris has an excellent post about custom subtotals using INSCOPE that has been pretty helpful to me.

Using a Matrix with OLAP cubes can sometimes be a bit painful and icky, but this technique makes adding additional info really easy.

Now all we need is access to a proper ternary operator instead of that horrible IIF vb-istic construct and we’d be laughing.