Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
MIKIEMILLER
Contributor III
Contributor III

Dual Line Graph based on selection

Hello,

I want to make a line graph that has two lines.  The dimension will be the Year.  When you click on a specific unit, one line will show that units total Type B value for each year, and a second line will show the average county type B value for each year.  Below is a small sample of the data.  There are more units, and counties that just this.

Graph.PNG

I would appreciate any help.

1 Solution

Accepted Solutions
sunny_talwar

I used these two expressions

1) Sum({<Type = {'B'}>}Amount)

2) Avg({<Type = {'B'}, Unit, County = p(County)>}Amount)

View solution in original post

11 Replies
sunny_talwar

Can you provide the data in an Excel file? Also, what would you see when nothing is selected?

MIKIEMILLER
Contributor III
Contributor III
Author

Sunny,

It is coming from a server, so I can only get some of the data.  There is a lot more, but this sample size shows everything I am dealing with.  I would love for the graph to show the total unit average per year for type B before I select a unit.  Then split into county and unit lines once selected.  If that isn't possible i can always just put in a formula into the data handling part of the graph to require the user to select a unit, and then two lines populate.

MIKIEMILLER
Contributor III
Contributor III
Author

Actually there are not units with zero, so this sample is correct.  Sorry about that.

sunny_talwar

What is the expected output based on the sample provided?

MIKIEMILLER
Contributor III
Contributor III
Author

Sunny,

This would be the desired outcome if you selected unit 4.  County would show the average for each year, while the unit would show their totals per year.

Dual Line.PNG

sunny_talwar

Like this

Capture.PNG

MIKIEMILLER
Contributor III
Contributor III
Author

Yes! I cannot open your .qvf file to see how you did it though.

sunny_talwar

Why not?

MIKIEMILLER
Contributor III
Contributor III
Author

I am not the admin on Qlik and cannot save it in the appropriate location to view it.