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: 
mcm
Contributor
Contributor

Bar Chart

How do I create a bar chart year wise which further on selecting a single bar will show the data (sales) month-wise? 

1 Solution

Accepted Solutions
trdandamudi
Master II
Master II

Here are the steps to create a bar chart by Year and then when you click it will show the months as bars:

I am using the below script as a sample to walk you thru the process.

Data:
Load * Inline [
ID,Year,Month,Amount
10,2010,Jan,100
20,2010,Feb,200
30,2010,Mar,300
40,2010,Apr,400
50,2010,May,500
60,2010,Jun,600
70,2011,Jan,100
71,2011,Feb,200
72,2011,Mar,300
73,2011,Apr,400
74,2011,May,500
75,2011,Jun,600
];

1) Click on "Master Items"

2) You will see Dimensions and under it you will see a button "Create new", Click on that button and you will see the following screen shot:

Screenshot_01.PNG

3) select "Drill-down"

4) Click on "Year" and then click on "Month", so that they will appear under Field: panel on the right

5) Give a name as "Drill_Year_Month"

6) Click on "Add dimension"

7) Click "Done"

😎 Create a Bar chart and for Dimension select "Drill_Year_Month"

9) Enter expression as Sum(Amount)

Now when you click on the Year bar , it will show the month bars.

Hope this is helpful.

Bar_Year.PNG

Bar_Month.PNG

View solution in original post

1 Reply
trdandamudi
Master II
Master II

Here are the steps to create a bar chart by Year and then when you click it will show the months as bars:

I am using the below script as a sample to walk you thru the process.

Data:
Load * Inline [
ID,Year,Month,Amount
10,2010,Jan,100
20,2010,Feb,200
30,2010,Mar,300
40,2010,Apr,400
50,2010,May,500
60,2010,Jun,600
70,2011,Jan,100
71,2011,Feb,200
72,2011,Mar,300
73,2011,Apr,400
74,2011,May,500
75,2011,Jun,600
];

1) Click on "Master Items"

2) You will see Dimensions and under it you will see a button "Create new", Click on that button and you will see the following screen shot:

Screenshot_01.PNG

3) select "Drill-down"

4) Click on "Year" and then click on "Month", so that they will appear under Field: panel on the right

5) Give a name as "Drill_Year_Month"

6) Click on "Add dimension"

7) Click "Done"

😎 Create a Bar chart and for Dimension select "Drill_Year_Month"

9) Enter expression as Sum(Amount)

Now when you click on the Year bar , it will show the month bars.

Hope this is helpful.

Bar_Year.PNG

Bar_Month.PNG