# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Contributor III

## How to merge 2 dimensions

Hi Qlikers,

I'm trying to find a way to merge 2 dimensions based on 2 conditions. For this I'm using Wildmatch but it doesn't work yet....

I have 2 dimensions [Dimension1] and [Dimension2]

[Dimension1]        [Dimension2]

CAT                       OTHER

CAT                       OTHER

CAT                       OTHER

OTHER                 OTHER

OTHER                 CAT

OTHER                 OTHER

...

if(wildmatch([Dimension1],'CAT'),'CAT',if(wildmatch([Dimension2],'CAT'),'CAT','OTHER')) .... But it doesn't work.

Any idea how I can merge this in the front end?

1 Solution

Accepted Solutions
Contributor III

## Re: How to merge 2 dimensions

Hi, I think it is just not possible to do what I want in dimensions. Because if I select my block "CAT" in the treemap, it will automaticaly trigger the 2 filters ([Dimension1] & [Dimension2]). And there is no logical way to filter on both to do what I want. I guess I will have to change all my measures in each graph by counting all the fields with 'CAT'. Or I have to add a conversion table to make it work...

11 Replies
Honored Contributor III

## Re: How to merge 2 dimensions

you can give  [Dimension1] & '-' & [Dimension2]

Vikas

Esteemed Contributor

## Re: How to merge 2 dimensions

may be this:

if(wildmatch([Dimension1],'CAT'),'CAT', if(wildmatch([Dimension2],'CAT'),'CAT','OTHER') ,'OTHER')

Not applicable

## Re: How to merge 2 dimensions

Hi,

maybe try this

if([Dimension1] = 'CAT' or [Dimension2] = 'CAT', [Dimension1] & [Dimension2], 'OTHER')

or this

if(WildMatch([Dimension1], 'CAT') or WildMatch([Dimension2], 'CAT'), [Dimension1] & [Dimension2], 'OTHER')

Valued Contributor II

## Re: How to merge 2 dimensions

Hi Xavier,

Can you tell me your expected output.

If you want  [Dimension2] into [Dimension1]

Like This??

PFA .......

Contributor III

## Re: How to merge 2 dimensions

Hi Qlikers,

Thanks for your quick answers. I tried all the solution you proposed but it doesn't do what I want. What happens is that it will filter on my first dimension1 so every thing that is not 'CAT' is automaticaly excluded. So I don't see my 'CAT' in Dimenson2...

[Dimension1]        [Dimension2]

CAT                       OTHER

CAT                       OTHER

CAT                       OTHER

OTHER                 OTHER

OTHER                 CAT

OTHER                 OTHER

The expected result is to have a Treemap with 1bloc "CAT" and one bloc "OTHER".

let me know if something is not clear.

Thanks

Contributor III

## Re: How to merge 2 dimensions

Hi,

I'm using Qlik Sense with .qvf files and not .qvw..

Xavier

MVP

## Re: How to merge 2 dimensions

try below

=if(match([Dimension1],'CAT'),'CAT',if(match([Dimension2],'CAT'),'CAT','OTHER'))

Not applicable

## Re: How to merge 2 dimensions

Where are you trying to match it? In Calculated dimension or in Expression?

Contributor III

## Re: How to merge 2 dimensions

I'm trying to do in calculated dimension.