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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
jonescm128
Contributor II
Contributor II

Top X Line Chart by Year

Hello,

I am trying to show a top X line chart trend and cannot figure out how to get the chart to reflect all years. I have 4 years worth of data that I want to trend. On the left is a bar chart that combines all years to get a total market share using num(SUM(RECORD_ID)/sum(total RECORD_ID),'#0%') with SYSTEM2 as a dimension and RECORD_ID as a measure that changes with a selected CY (calendar year) filter.

I would like the trend chart on the right to reflect each years market share. Right now it looks like it is dividing by the four years.

Capture.PNG

 

When I select a specific year it gives me the correct values. How do I get my line chart to reflect these correct values for ALL years, regardless of changes to the CY (calendar year) filter?

2017

Capture2.PNG

 

1 Solution

Accepted Solutions
chrismarlow
Specialist II
Specialist II

Hi,

Try;

num(SUM({<CY=>}RECORD_ID)/sum({<CY=>}total <CY> RECORD_ID),'#0%')

Cheers,

Chris.

View solution in original post

4 Replies
chrismarlow
Specialist II
Specialist II

Hi,

Have you tried num(SUM(RECORD_ID)/sum(total <CY> RECORD_ID),'#0%') ?

Cheers,

Chris.

jonescm128
Contributor II
Contributor II
Author

This works but is there a way to make my chart static? So always show the four years for the trending regardless of the year selected in the filter? I have other visuals that need to work with the year filter but want to keep this one as a trend with all years showing.

chrismarlow
Specialist II
Specialist II

Hi,

Try;

num(SUM({<CY=>}RECORD_ID)/sum({<CY=>}total <CY> RECORD_ID),'#0%')

Cheers,

Chris.

jonescm128
Contributor II
Contributor II
Author

This is great, thank you! Still trying to figure out the syntax for expressions 🙂