Discussion board where members can get started with Qlik Sense.
Hi all,
I'd like to make a bar chart 'number of colleagues by profile' by displaying the number next to the bar.
The bar must be negative as it is compared with another chart but the displayed number must be positive.
How can I handle this in QS?
Thanks a lot
Solved! Go to Solution.
This is exactly what this article talks about:
Note: For the following example I got a sample data containing Population by Age data from the US census. It has 3 columns, Age Range, Male population and Female population.
As a general note remember we can set up the format for positive and negative values for any expression. Format argument in the Num function can take 2 parameters, first one indicates how to format the number if it is >0 and the second piece if number <0.
=num(sum(x), 'postivenumberFormat;negativenumberFormat')
As I want negative and positive number to look exactly the same I could use the following format arguments:
num(sum(FemalePopulation)*-1,’#,##0;#,##0’)
Hi Thierry,
I am sorry, but i don't think this is possible as with the standard functionality.
If you multiple the the expression by -1 will turn it negative, but as far as I am aware value labels will always give you the Value of the expression.
It maybe possible via an extention?
Mark
thx... sometimes I miss QlikView
Hi,
I think maybe changing the number format for the measure would work, something like this:
This would result in numbers on the bars shown as negative with no decimal point. You can of course change the number resolution, like this:
Maybe this will help, good luck!
Micha
Have you tried with a dual?
Something like:
Dual(Fabs(<your expression>), <your expression>)
or
Dual((<your expression>)*-1, <your expression>)
thx.. good to know. but in my case the 2 measures (pos and neg) are different. In your example, it's the same.
almost.. the expression is negative.
if I add a "-" in the format, I'll have : " -- " .
thx for your reply
This is exactly what this article talks about:
Note: For the following example I got a sample data containing Population by Age data from the US census. It has 3 columns, Age Range, Male population and Female population.
As a general note remember we can set up the format for positive and negative values for any expression. Format argument in the Num function can take 2 parameters, first one indicates how to format the number if it is >0 and the second piece if number <0.
=num(sum(x), 'postivenumberFormat;negativenumberFormat')
As I want negative and positive number to look exactly the same I could use the following format arguments:
num(sum(FemalePopulation)*-1,’#,##0;#,##0’)
make a changes in number format in the properties of a chart