Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
NormanStanleyBadger

Line Chart : Combined total line for dimension values

Hello, I hope everyone is well. 

I pulled the following script and expression from the forums to create a combined total line for a dimension on a line chart.

Script

MyTable:
LOAD * INLINE [
Dim
1
2
];

Y Axis Dimension

Pick(Dim, MyDimension, 'Combined')

It works like a treat for all the measures I have that are straight forward Sum() aggregations, but I also have measures that contains Aggr() within a Sum() and it is crashing for these. 

Is this fixable? Is there another way of going about it?

Thanks in advance.

Labels (5)
6 Replies
Anil_Babu_Samineni

@NormanStanleyBadger 

I guess, You want to forcee total as Combined in X-Axis? If so, do like this.

Dimension: Pick(Dim, MyDimension, 'Combined')

Expression: Pick(Dim, Sum(Sales), Sum(Total Sales))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
NormanStanleyBadger
Author

This has not worked for me. I am getting a null entry on the X axis distinct from the period values with a single point total value and a zero value. 😞

Anil_Babu_Samineni

Try to share sample data with QVF to demonstrate the same.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
NormanStanleyBadger
Author

I cannot do that as it is company data.

The set analysis is as below. The formula works as expected as a straightforward measure.

Sum(

{<Set Expression>}

Aggr(

{<Set Expression>}

NetWorkDays(

FirstSortedValue({<Set Expression>}),FirstSortedValue({<Set Expression>})

)

,MyDimension

)

)

 

 

Anil_Babu_Samineni

Great that it is fixed, You can mark your answer as solution. 

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
NormanStanleyBadger
Author

Sorry, no, it's not fixed. That's my measure which works ok, but when I try to produce the total line on the line chart it crashes.