Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikwiz123
Creator III
Creator III

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 - Master
Partner - Master

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'))))
martinpohl
Partner - Master
Partner - Master

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

qlikwiz123
Creator III
Creator III
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)
qlikwiz123
Creator III
Creator III
Author

Awesome, Savior you are 🙂