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

Bar Chart with positive and negative numbers

Hi all,

I want to create a bar chart with columns per month. In each month I want to show a "positive" column showing the number of customers that are active, while also showing a "negative" column with the number of customers that are notactive.

Attached xls file for your reference including the raw data. Based on that file, I'd like to have a graph showing three columns for the months of Feb/Mar/Apr. Then:

> in Feb the column should go from -1 to 1 (from -1 to 0 in red and from 0 to 1 in blue)

> in Mar the column should go from -2 to 3 (from -2 to 0 in red and from 0 to 3 in blue)

> in Mar the column should go from -3 to 5 (from -3 to 0 in red and from 0 to 5 in blue)


Thanks,

Dani

1 Solution

Accepted Solutions
rubenmarin

Hi Dani, with this script:

LOAD Date(Date#(Left(Month,3)&Right(Month,2), 'MMMYY')) as Date,

     [Active yesno],

     Customer

FROM

[.\Book1.xlsx]

(ooxml, embedded labels, table is Sheet1);

and this expressions:

Active: count({<[Active yesno]={'active'}>} Customer)

Not active: count({<[Active yesno]={'notactive'}>} Customer)*-1

And checking 'Stacked0' in style tab

returns this:

View solution in original post

1 Reply
rubenmarin

Hi Dani, with this script:

LOAD Date(Date#(Left(Month,3)&Right(Month,2), 'MMMYY')) as Date,

     [Active yesno],

     Customer

FROM

[.\Book1.xlsx]

(ooxml, embedded labels, table is Sheet1);

and this expressions:

Active: count({<[Active yesno]={'active'}>} Customer)

Not active: count({<[Active yesno]={'notactive'}>} Customer)*-1

And checking 'Stacked0' in style tab

returns this: