Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to obtain a partial total by dimension

Hi all!

Please find image attached:

Mc = Count(total <DESTINAZIONE, MEZZO> MVCDE) * MZPRT // MVCDE and MZPRT are two db fields

Tot Mc = sum(total <DESTINAZIONE> Mc)

Why am I getting 0 values as result? I don't understand where I'm making mistake, the red values shown in figure are the result I would expect...

Do you need to know more details about db structure?

Thanks in advance.

--

Marco Pikiri

15 Replies
Not applicable
Author

Yes, i.e. the column after "DESTINAZIONE" dimension.

After "Mc" there is "Tot Mc" expression that is the sum of "Mc" values grouped by "DESTINAZIONE" dimension.

giakoum
Partner - Master II
Partner - Master II

somehting like the attached?

Not applicable
Author

In the attached, "Tot Mc" is not correct, but "Tot Mc new" almost.

I say almost because I would expect the same values also for "DUMPER 2" MEZZO, and not a series of 0..

Anyhow... ... what a concatenation of functions! But where could I start to understand the logic behind this solution? i.e., which could be the best approach?

giakoum
Partner - Master II
Partner - Master II

Sum(total<DESTINAZIONE> aggr(distinct Count(MVCDE)*MZPRT, DESTINAZIONE, MEZZO))

http://community.qlik.com/thread/61292

Not applicable
Author

Thank you very much! This is the expected result!!!

giakoum
Partner - Master II
Partner - Master II

Dont thank me! Whiteline is to thank!