Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Become an analytics expert with Qlik's new 15 week course: Applied Data Analytics using Qlik Sense. READ MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikwiz123
Creator II
Creator II

Merge two values to create one in Dimension

I have a Calculated Dimension as below:

 

=if(vFlag=1,
if(Response = '1', 'A',
if(Response = '2', 'B',

if(Response = '3, 'C',

if(Response = '4', 'D'))))

 

I need to merge Responses 3 and 4 and show them as 'D'.

I am using this but it does not work 

if(pick(Match(Response, '3','4'), 4,3)=1,'D'

I have also tried if(Response='3' or '4','D') but still doesn't work.

 

 

Labels (3)
3 Solutions

Accepted Solutions
sunny_talwar

Try this

=if(vFlag=1,
   if(Response = '1', 'A',
   if(Response = '2', 'B',
   if(Response = '3', 'D',
   if(Response = '4', 'D'))))

or

=if(vFlag=1,
   if(Response = '1', 'A',
   if(Response = '2', 'B',
   if(Match(Response, '3', '4'), 'D'))))

View solution in original post

martinpohl
Partner
Partner

if(match(Response,'3','4'),D) 

View solution in original post

sunny_talwar

Change the expression to this

Count({<Response = {"=Len(Response) > 0"}>} Response)

View solution in original post

5 Replies
sunny_talwar

Try this

=if(vFlag=1,
   if(Response = '1', 'A',
   if(Response = '2', 'B',
   if(Response = '3', 'D',
   if(Response = '4', 'D'))))

or

=if(vFlag=1,
   if(Response = '1', 'A',
   if(Response = '2', 'B',
   if(Match(Response, '3', '4'), 'D'))))

View solution in original post

martinpohl
Partner
Partner

if(match(Response,'3','4'),D) 

View solution in original post

qlikwiz123
Creator II
Creator II
Author

Hi @sunny_talwar  I have used both but the issue is, I have an expression in the chart 

(if(Len(Response)>0, count(Response)))

 

This only gives me two Dimensions A and B but not D. When I remove the expression and create a dummy empty expression, I am able to see A, B, and D. Am I doing something wrong here? The Expression is the issue.

sunny_talwar

Change the expression to this

Count({<Response = {"=Len(Response) > 0"}>} Response)

View solution in original post

qlikwiz123
Creator II
Creator II
Author

Awesome, Savior you are 🙂