PDA

View Full Version : how to use NameExpression?



mdanetzky
04-03-2003, 01:52 AM
hi,
I, just tried to display a cube dependant names of dimensions, but I wasn't able to get the NameExpression to work.
In my case the table consists of text fields with {'10-20','20-30', etc.} and the dimension name's output should be like {'age between 10-20 years','age between 20-30 years', etc.}
What do I have to be aware of?
Thanks in advance
matthias

jhyde
04-03-2003, 06:49 AM
I don't think I ever tested this feature, so of course, it doesn't work. Please log a bug.
<NameExpression> should be a child element of <Level>, occurring after <KeyExpression> and before <OrdinalExpression> and <ParentExpression>, if these are present. It should be a SQL expression, like the <KeyExpression> example in FoodMart.xml.
If you're feeling brave, attach the debugger and try and fix this. I'm going camping for a few days, and I they don't have Internet access out there.

mdanetzky
04-03-2003, 10:45 PM
I'd love to do it, but I cannot get the perforce server account due to "maximum user count reached" error.
Are the Mondrian 0.5 sources (SF downloadable release) up-to-date for changing/implementing NameExpressions?
matthias

jhyde
04-05-2003, 04:44 PM
Login to perforce as 'guest', and you won't need another license.
The Mondrian 0.5 sources are good enough for this change. I can easily integrate whatever change you make into the latest.

j_nep
10-29-2009, 07:14 AM
Anybody knows if it's working NameExpression?

I've the following dimension but it doesn't work:


<Hierarchy name="All Status" hasAll="true" allMemberName="All Status" primaryKey="status_tk" caption="Status">
<Table name="dim_status">
</Table>
<Level name="Status" column="flag" type="String" uniqueMembers="true" levelType="Regular" hideMemberIf="Never">
<NameExpression>
<SQL dialect="mysql">
CASE WHEN dim_status.flag = 'Y' THEN 'Started' ELSE 'Ended' END
</SQL>
<SQL dialect="generic">
(case when dim_status.flag = 'Y' then 'Started' else 'Ended' end)
</SQL>
</NameExpression>
</Level>
</Hierarchy>
</Dimension>

sdmsec
10-31-2009, 12:30 AM
The following "Expressions" are working for me (using SQL Server):


<Level name="Type" column="entityId" type="String" uniqueMembers="true" levelType="Regular" hideMemberIf="Never">

<NameExpression><SQL>callReportTypeBusinessKey + ' ' + dimCallReportType.description</SQL></NameExpression>

</Level>

<Level name="Branch" type="String" uniqueMembers="true" levelType="Regular" hideMemberIf="Never">

<KeyExpression><SQL>branchName</SQL></KeyExpression>

</Level>


<Level name="Days Past Due" column="coarseTiers" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">

<OrdinalExpression><SQL>CASE WHEN dimDelinquency.entityId &lt; 30 THEN 0 WHEN dimDelinquency.entityId &lt; 90 THEN 2 ELSE 3 END</SQL></OrdinalExpression>

</Level>