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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to get Sum of Max values in a diagram

Dear all,

I have a problem summing up the Max values over 2 dimensions.

What I thought to be basic seems to be quite tricky:

Two data sources ("Meldestelle") send usage data should ("Soll")/is ("Ist") for two services "Derivat"

I create a diagram with

  • Bars abs."should" accumulated ->ok
  • Bars abs."is" accumulated ->ok
  • Line relative "should" ->problem
  • Line relative "is" ->problem

For the latter 2 I tried

=sum(TIF_TABLE.accum_soll_h) / sum(Max(TOTAL TIF_TABLE.accum_soll_h))

Or alike but the divisor seems to evaluate wrong:

I would expect sum(Max(TOTAL TIF_TABLE.accum_soll_h)) to give me the max of - in this case the sum(TIF_TABLE.accum_soll_h).

All works out, when selecting ONE "Meldestelle" and ONE Derivat:

Over multiple it fails…

I also tried with aggr - like

sum(Aggr(Max(TIF_TABLE.accum_soll_h),TIF_TABLE.%MeldeStelle_Key ))

But results look even more strange…

Someone can help, please?

Thanks Oliver

1 Solution

Accepted Solutions
sunny_talwar

See if these work:

=Sum(TIF_TABLE.accum_soll_h) / Max(TOTAL Aggr(Sum(TIF_TABLE.accum_soll_h), TIF_TABLE.I_Stufe.MeilenStein_Woche))

=Sum(TIF_TABLE.accum_ist_h) / Max(TOTAL Aggr(Sum(TIF_TABLE.accum_ist_h), TIF_TABLE.I_Stufe.MeilenStein_Woche))

Capture.PNG

View solution in original post

2 Replies
sunny_talwar

See if these work:

=Sum(TIF_TABLE.accum_soll_h) / Max(TOTAL Aggr(Sum(TIF_TABLE.accum_soll_h), TIF_TABLE.I_Stufe.MeilenStein_Woche))

=Sum(TIF_TABLE.accum_ist_h) / Max(TOTAL Aggr(Sum(TIF_TABLE.accum_ist_h), TIF_TABLE.I_Stufe.MeilenStein_Woche))

Capture.PNG

Not applicable
Author

Hi Sunny,

thanks a lot - it took me several hours trying before I finally posted the question... You solved it! 🙂

Have a nice weekend Oliver