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

Stacked Bar Chart - Can't get the Dual() function to work

Hi,

I've got a problem with getting some customized labels on my bars in a stacked bar chart.

Through reading other posts, i've seen cases where people have used Dual(string,num) to provide a customized label for the bars in the chart.

I have the following options enabled in the chart properties:

  • Expressions tab: Values on Data Points
  • Number tab: Format = Expression Default
  • Presentation tab: Plot Values Inside Segments

What i'm doing is this: i have an expression set up with a dual(value+string, value) and i'm expecting to see the value+string inside each segment.

The expression for the moment is:

=Dual(if(Rev > Budget1, Budget1, Rev) & '(45%)',  if(Rev > Budget1, Budget1, Rev))

No matter what i try, i can't get it to display the number and text - it always just displays an unformatted number. I've inserted an image of what i've tried below (with figures blacked out, but you can clearly see if doesn't end in "(45%)" ).

Stacked Bars Dual.JPG

I'm using Qlikview 11 SR 2. What am i doing wrong!?

Any help you guys can provide is most appreciated.

Cheers,

Ben

1 Solution

Accepted Solutions
Not applicable
Author

I've played around a bit, and discovered that with the number formatting it works, but only when i disable my uncharted fields.

I'll try to integrate them in and have giant expressions, and see if that works.

Thanks Fernando.

EDIT: Marking this as correct as the actual cause of the issue was the uncharted expressions in the chart. This is what was causing the extra formatted text to not display. The number formatting fernando suggested doesn't appear to be required (it's working without it).

View solution in original post

4 Replies
fosuzuki
Partner - Specialist III
Partner - Specialist III

You have to include the number format in the string portion of the dual function like this:

=Dual(num(if(Rev > Budget1, Budget1, Rev), '#,##0.00') & '(45%)',  if(Rev > Budget1, Budget1, Rev))

Hope this helps you

Fernando

Not applicable
Author

Thanks Fernando,

I tried including the number formatting, but that didn't make any change unfortunately.

Any other ideas?

Cheers,

Ben

Not applicable
Author

I've played around a bit, and discovered that with the number formatting it works, but only when i disable my uncharted fields.

I'll try to integrate them in and have giant expressions, and see if that works.

Thanks Fernando.

EDIT: Marking this as correct as the actual cause of the issue was the uncharted expressions in the chart. This is what was causing the extra formatted text to not display. The number formatting fernando suggested doesn't appear to be required (it's working without it).

christian_timm
Partner - Contributor
Partner - Contributor

Hello,

I have the same problem. Reading the previous posts I ask myself: what are uncharted fields?

Kind regards

Christian