Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

cancel
Showing results for 
Search instead for 
Did you mean: 
jmonroe918
Creator II
Creator II

Combine Dimensions in a Bar Chart

I have a bar chart that has  a Dimension of Brochures.Class. The data contains either Class III, Class II, Class I and OTC Drug.

Currently the chart lists each Dimension and sums the number of Total to Review and Total Completed in a stacked bar chart.

How can I combine the Class III and Class II bars into a single bar summing up both (Call it Class II/III). And do the same for Class I and OTC Drug (Call it Class I/Other). So I basically end up with a two-bar chart showing the sum of two expressions.

QVD is attached.

Thanks

Jeff

1 Solution

Accepted Solutions
arvind_patil
Partner
Partner

Hi Jeff,

Please add below code in dimension as calculated dimesion:

=If(Wildmatch(Brochures.Class,'Class 2','Class 3'),'Class II/III',

  If(Wildmatch(Brochures.Class,'Class 1','OTC Drug'),'Class I/Other'))


Thanks,

Arvind Patil

View solution in original post

7 Replies
arvind_patil
Partner
Partner

Hi Jeff,

Please add below code in dimension as calculated dimesion:

=If(Wildmatch(Brochures.Class,'Class 2','Class 3'),'Class II/III',

  If(Wildmatch(Brochures.Class,'Class 1','OTC Drug'),'Class I/Other'))


Thanks,

Arvind Patil

arvind_patil
Partner
Partner

Please find the attachment.

Thanks,

Arvind Patil

prma7799
Master III
Master III

Like this?

jmonroe918
Creator II
Creator II
Author

Arvind,that worked perfectly.

Thanks

Jeff

tresesco
MVP
MVP

Please note that if you have to compare without wildcards, using match() is a better choice in terms of performance. And also, be careful of the fact that wildmatch() is case insensitive whereas match() is case sensitive.

jmonroe918
Creator II
Creator II
Author

Thanks, I'll keep that in mind

arvind_patil
Partner
Partner

Happy to help you!

Thanks,

Arvind Patil