Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Butterfly chart in QlikView [data values query]

Hello everyone,

I came across a video of developing a butterfly chart on qlikview and found it really interesting (link: https://veblr.com/watch/361f90967d31/how-to-create-tornado-or-butterfly-chart-in-qlikview?lang=en)

If you notice, the trick is to multiply the previous year's values with -1 to get them on the left side of the axis.

I could make the chart but now the issue is that the data values in tool-tip are showing as negative (see attached photo). Does anyone know of a possible way to make the actual & correct data values show on the tool-tip?

I am new to QV so any help would be much appreciated

-Shivi

5 Replies
oscar_ortiz
Partner - Specialist
Partner - Specialist

Have you tried using the DUAL() function?

dual( s , x )

Forced association of an arbitrary string representation s with a given number representation x. In QlikView, when several data items read into one field have different string representations but the same valid number representation, they will all share the first string representation encountered. This function can be used in scripts and chart expressions.

In scripting, the dual function is typically used early in the script, before other data is read into the field concerned, in order to create that first string representation, which will be shown in list boxes etc.

Note!
If a dual value is too large to fit in a field object, it will be represented by ## and not truncated with ... like a string.

Example (scripting):

load dual ( string,numrep ) as DayOfWeek inline

[ string,numrep

Monday,0

Tuesday,1

Wednesday,2

Thursday,3

Friday,4

Saturday,5

Sunday,6 ];

load Date, weekday(Date) as DayOfWeek from afile.csv;

The script example will generate a field DayOfWeek with the weekdays written in clear text. QlikView will for all purposes regard the field as a numeric field.

swuehl
MVP
MVP

There are more samples here in the forum that shows how to create a butterfly chart, just search for butterfly chart.

I think the most easy way to change the tooltip is to change the number format on number tab for the negative values (which you can define without a minus sign) like

# ##0; # ##0

Not applicable
Author

Hey,

when I tried this, the minus sign is going but I am getting ## 0. I just changed the number format to fixed to with 1 decimal and format matter to "# ##0; # ##0". Am I doing something wrong?

jonathandienst
Partner - Champion III
Partner - Champion III

That's because the number format is inconsistent with the 1000s separator. if you use "# ##0; # ##0" as a format, make sure that <space> is the 1000s separator. Or use ',' as the 1000s separator, and "#,##0;#,##0" as the format.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Awesome, done ! Thank you soo much