Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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

Tags (1)
1 Solution

Accepted Solutions

Re: Dimension

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
9 Replies
sujeetsingh
Honored Contributor III

Re: Dimension

Akrati,

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

sujeetsingh
Honored Contributor III

Re: Dimension

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

Not applicable

Re: Dimension

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
Honored Contributor III

Re: Dimension

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

Re: Dimension

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

Re: Dimension

Hi

thanks for the reply.

I will try this and get back to u.

Not applicable

Re: Dimension

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
Honored Contributor III

Re: Dimension

Just go to label on expression tab and do it

Not applicable

Re: Dimension

Thanks...

Done with that!!!

Community Browser