Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Coming Aug. 9: New Simplified Authoring for Qlik Sense SaaS – For Details, CLICK HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
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

1 Solution

Accepted Solutions
sunny_talwar

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

];

View solution in original post

8 Replies
MK_QSL
MVP
MVP

What's issue in using only below one?

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

Not applicable
Author

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.

sunny_talwar

May be this:

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

Not applicable
Author

i tried this,

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

MK_QSL
MVP
MVP

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

sunny_talwar

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
Author

its working sunny.

thanks a lot.

Not applicable
Author

thank you so much manish