Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Doubt in column chart

hello,

I want to show the data for the unavailable months in bar chart which should be sum(Quantity for available months)/(No. of months),

Please see attached sheet.

Thanks,

swati

Labels (1)
9 Replies
vvvvvvizard
Partner - Specialist
Partner - Specialist

ctr +  e , select "table files " on bottom screen , choose the excel sheet  , click next , next , next .

ctr+r , to load the data in

right click , new chart , choose bar graph ,click next ,  in the dimension tab add month  , click next , in the expression tab add Sum(Quantity)/Count(Month)

click next next next until the end .

arulsettu
Master III
Master III

like thisthread.png

vvvvvvizard
Partner - Specialist
Partner - Specialist

Yes that is correct ,

You might just want to sort you months in order , if you right click on the bar chart , properties , sort tab , choose month  check box , ascending order , unlclick other checkboxes

Not applicable
Author

I want to show the Quantity

for Oct,Nov and Dec in the same chart after Sep and values for all three (Oct,Nov,Dec) should be sum(Quantity(Jan+Feb+...+Sep)/9) in this case. so, quantity for last 3 months will be avg of first 9 months.

Not applicable
Author

Hi,

load below table:

Load * inline [

Month,Quantity
Jan,234
Feb,45
Mar,35
Apr,45
May,565
Jun,23
Jul,12
Aug,324
Sep,155

Oct

Nov

Dec

];

try the below expression in your chart.

if(sum(Quantity)=0,sum(TOTAL Quantity)/Count({<Quantity = {'>0'}>}  Month),sum(Quantity))

Not applicable
Author

I am still not getting values for last 3 months.

vvvvvvizard
Partner - Specialist
Partner - Specialist

Try if(sum(Quantity)=0,Sum(TOTAL Quantity)/9,sum(Quantity))

Not applicable
Author

By this wat I will get the value but its hard coding which we cannot do, data may change later.

vvvvvvizard
Partner - Specialist
Partner - Specialist

Try

A:
Load * inline [

Month, Quantity
Jan, 234
Feb, 45
Mar, 35
Apr, 45
May, 565
Jun, 23
Jul, 12
Aug, 324
Sep, 155

Oct,

Nov,

Dec,

]
;

B:
Load *,

if(len(Quantity)>0,Quantity,0) as Counterr
resident A;
drop table A;

Now press CTR+ALT +V and add a variable named

counter2 with expression

=count(if(Counterr>0,Month))

Now add an expression

if(sum(Quantity)=0,Sum(TOTAL Quantity)/$(counter2),sum(Quantity))