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

Show Total in Line Chart - Sum the "Line" attribute

I have a line chart with the dimension "Accounting Period", which has data in the "YYYY-MM" format. For the line, I am using Status", which is "Level 1" or "Level 2". The measure, height, is the count of "Status".  I load in the full data set, 9 columns, and then I want to do all my aggregation within Qlik Sense.

I want to create a "Total" line which sums the statuses together. I looked around at other solutions, but I was unable to implement them due to them adding an additional measure. 

Capture.PNG

 

I am able to get it in Pivot Table below, so I would really like to graph the Pivot table with the "Totals".

 

Capture2.PNG

Any assistance in getting a "Total" line to show up in the line chart would be greatly appreciated!

Labels (1)
  • Chart

1 Solution

Accepted Solutions
Kushal_Chawda

Create inline table like below

Load * Inline [
Dim
1
2 ];

In line chart use below dimension

1) Period

2) Pick(Dim,Status,'Total')

expression you can keep the same

View solution in original post

8 Replies
mskusace
Creator
Creator
Author

Looks like @sunny_talwar 's solution in the post worked. However, I am unsure how it worked like the OP of that question.

https://community.qlik.com/t5/New-to-Qlik-Sense/line-chart-with-total/td-p/1458005

I am unsure of how the LOAD * INLINE and the PICK(...) in the dimension resolves this.

 

Kushal_Chawda

Create inline table like below

Load * Inline [
Dim
1
2 ];

In line chart use below dimension

1) Period

2) Pick(Dim,Status,'Total')

expression you can keep the same

mskusace
Creator
Creator
Author

Thanks @Kushal_Chawda ! 

Is there a way for me to rename the fields in the "LEGEND" from "Level 1" and "Level 2", to custom values? I want to rename them to be more descriptive.

Kushal_Chawda

there are many ways of doing it

1) In load statement put pick(match(condition

      pick(match(Status,'Level 1','Level 2'),'Description for level 1','Description for level 2') as Status_Description

 

2) Create inline table 

load * inline [

Status, Status_Description

Level 1, Description 1

Level 2, Description 2 ]

Now you can call this new description field in chart

mskusace
Creator
Creator
Author

Thank you very much! You have solved both my problems for this app :). Thanks for answering the 2nd one even though it was out of scope of the original topic. I wish I could accept both as a solution.

Kushal_Chawda

No problem. Glad that I was able to help

TLX-QlikView
Contributor III
Contributor III

Thanks a lot. This worked for me. 

We had a line chart with 2 dimension and a measure. Need to add TOTAL line. It worked like a Charm.

TLX-QlikView
Contributor III
Contributor III

One more requirement, for the TOTAL line alone, can we change the thickness?

The Dim value will be 2, but in the styling option of line chart, there is no option for any expression.