Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Dimension

Hi All,

I have dimension like Mod_1, mod_2, mod_3 and new_1, new_2, new_3.

Now i want to use 'case statement' so that my result wil b mod_1, mod_2, mod_3 = 'Mod' and same as with 'New'.

please suggest how to use case statemnt in dimesion. I need this on urgent basis.

Thanks

1 Solution

Accepted Solutions
Gysbert_Wassenaar

try this as a calculated dimension:

if(wildmatch(MyDimension,'mod'),'Mod',if(wildmatch(MyDimension,'new'),'New'))

But perhaps you should fix this in the load script by adding a mapping table and using applymap to create a new field ModNew. The use the new field instead of the original dimension.

MapDim:

mapping load * inline [

Key,Value

mod_1, Mod

mod_2, Mod

mod_3, Mod

new_1, New

new_2, New

... etc

];

load *, applymap('MapDim', FieldWithModAndNew) as ModNew

from ... etc


talk is cheap, supply exceeds demand

View solution in original post

9 Replies
sujeetsingh
Master III
Master III

Akrati,

Clik on calculated dimention tab  and write the desired Case Statement for your requirement.

sujeetsingh
Master III
Master III

And if you eloborate your Case functionality than i can help you ..

Not applicable
Author

Hi,

In the X-axis, i want MOD and NEW instead of mod_1, mod_2

i want mod_1 and mod_2 comes under MOD by using the case statement.

How its possible?

sujeetsingh
Master III
Master III

Sorry i didnt get u ...Why dont u just give a sample

Gysbert_Wassenaar

try this as a calculated dimension:

if(wildmatch(MyDimension,'mod'),'Mod',if(wildmatch(MyDimension,'new'),'New'))

But perhaps you should fix this in the load script by adding a mapping table and using applymap to create a new field ModNew. The use the new field instead of the original dimension.

MapDim:

mapping load * inline [

Key,Value

mod_1, Mod

mod_2, Mod

mod_3, Mod

new_1, New

new_2, New

... etc

];

load *, applymap('MapDim', FieldWithModAndNew) as ModNew

from ... etc


talk is cheap, supply exceeds demand
Not applicable
Author

Hi

thanks for the reply.

I will try this and get back to u.

Not applicable
Author

I just want to know, how to rename the expression??

In my tooltip the whole expression is visible.. i want to rename this

how to do?

sujeetsingh
Master III
Master III

Just go to label on expression tab and do it

Not applicable
Author

Thanks...

Done with that!!!