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

Bar Chart

Hi Friends

I have some data in the following table and I want to create bar chart in QV with the data in the table

YEARTYPEMAY-JUN-JULOTHER-MONTHS
2013A40,017,693125,167,132
2013B938,739,8042,474,358,841
2013C23,725,41874,356,983
2013D 2,505,4411,104,019
2014A32,453,750127,146,085
2014B819,656,7142,190,669,436
2014C38,339,791105,759,591
2014D214,836,239450,894,057
2015A52,992,68183,557,779
2015B930,098,5742,502,012,638
2015C42,550,921119,393,652
2015D251,770,244613,886,830

In the chart I have in my mind I want the following

X axis should represent  years and two bars for 1. MAY_JUN_JUL

                                                                     2. OTHER MONTHS

Two Bars should have relative % amount shown above representing type A B C and D

Pls help me to create this chart with a sample QV document

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

You have to change the expression...

SUM(CRE_PAID_AMOUNT)/sum(TOTAL <PAID_YEAR,PERIOD>CRE_PAID_AMOUNT)

View solution in original post

14 Replies
avinashelite

Try like this :

1.Create a Bar chart > Add Dimension as YEAR and TYPE

2. Add expression 1.sum(MAY-JUN-JUL) >expression label  >MAY-JUN-JUL

                                2.sum(OTHER-MONTHS)> expression label  >OTHER-MONTHS

for both the expression check the relative option in the expression tab. Currently I don't have QV licence so could not build a sample app for the same.

Hope this info will help you

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

Script:

Temp:

CrossTable(MonthGroup, TempValue, 2)

LOAD *

INLINE [ 

YEAR, TYPE, MAY-JUN-JUL, OTHER-MONTHS

2013, A, "40,017,693", "125,167,132"

2013, B, "938,739,804", "2,474,358,841"

2013, C, "23,725,418", "74,356,983"

2013, D, "2,505,441", "1,104,019"

2014, A, "32,453,750", "127,146,085"

2014, B, "819,656,714", "2,190,669,436"

2014, C, "38,339,791", "105,759,591"

2014, D, "214,836,239", "450,894,057"

2015, A, "52,992,681", "83,557,779"

2015, B, "930,098,574", "2,502,012,638"

2015, C, "42,550,921", "119,393,652"

2015, D, "251,770,244", "613,886,830"

];

Data:

LOAD

*,

SubField(TempValue, ',') AS Value

RESIDENT Temp;

DROP TABLE Temp;

Chart: Barchar

Dimension: MonthGroup, TYPE

Expression: =Sum(Value)/Sum(TOTAL<MonthGroup> Value)

In Style tab select Stacked and in number tab select Integer and Percentage.

Hope this helps you.

Regards,

jagan.

upaliwije
Creator II
Creator II
Author

Thanks 

But I have done it the way you have said But the Year does not come into the picture

avinashelite

could you please share the script and the bar expression what you have used so that we could check the same

upaliwije
Creator II
Creator II
Author

My sample QV document is attached pls

jagan
Luminary Alumni
Luminary Alumni

Hi,

Can you attach sample chart that you required?  So that it would be easier to understand.

Regards,

jagan.

upaliwije
Creator II
Creator II
Author

T.qvw is attached But I want all  bars of 100% in length is it possible ?

MK_QSL
MVP
MVP

Like this?

MK_QSL
MVP
MVP

have you check my reply?