Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Not applicable

conditional dimension

Hi Experts,

i have a dimension called Branchcode. it has the following values

Branchcode:

0001,

0002,

....

0501,

0601,

OP01,

DP02,

DP04,

CD03,

RF01, etc...

i have to use this dimension where it excludes 0501, 0601, code with text.

but it should have the codes that start with 'DP' . how can i do this.

i tried like this.

if(not Match(Branchcode,'0501','0601','0701')AND IsNum(Branchcode) and not match(left(Branchcode,2),'DP'), Branchcode)

but it is giving nulls.

Please help

Tags (1)
1 Solution

Accepted Solutions

Re: conditional dimension

Check this out:

Capture.PNG

Table:

LOAD *,

  If(not Match(Branchcode,'0501','0601','0701') and IsNum(Branchcode) or Wildmatch(Branchcode, '*DP*'), Branchcode) as BranchcodeNew;

LOAD * Inline [

Branchcode

0001,

0002,

0501,

0601,

OP01,

DP02,

DP04,

CD03,

RF01

];

8 Replies
MVP
MVP

Re: conditional dimension

What's issue in using only below one?

Where not Match(Branchcode,'0501','0601','0701')

Not applicable

Re: conditional dimension

no problem in that part.


if(not Match(Branchcode,'0501','0601','0701')AND IsNum(Branchcode) and

not match(left(Branchcode,2),'DP'), Branchcode)


the part highlighted in red is not working.

Re: conditional dimension

May be this:

If(not Match(Branchcode,'0501','0601','0701') and IsNum(Branchcode) or Wildmatch(Branchcode, '*DP*'), Branchcode)

Not applicable

Re: conditional dimension

i tried this,

it is giving values for the first two part but not 'DP'

MVP
MVP

Re: conditional dimension

Where (Not Match(Branchcode,'0501','0601','0701') and IsNum(Branchcode)) or WildMatch(Branchcode,'DP*')

Re: conditional dimension

Check this out:

Capture.PNG

Table:

LOAD *,

  If(not Match(Branchcode,'0501','0601','0701') and IsNum(Branchcode) or Wildmatch(Branchcode, '*DP*'), Branchcode) as BranchcodeNew;

LOAD * Inline [

Branchcode

0001,

0002,

0501,

0601,

OP01,

DP02,

DP04,

CD03,

RF01

];

Not applicable

Re: conditional dimension

its working sunny.

thanks a lot.

Not applicable

Re: conditional dimension

thank you so much manish