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: 
romansysyuk
Contributor II
Contributor II

Total<> unexpected behavior

There is a Table with 3 dimensions and one measure Measure1 = Sum(X).

Dimension1 Dimension2 Dimension3 Measure1 Measure2

Dimension1Dimension2Dimension3Measure1Measure2
1Ai10100
2Ai100100
3Aq3030
4Bq4040
5Bd3030
6Bd3030

I need to create second measure with Max Measure1 result aggregated by Dimension2&Dimension3 (ignoring Dimension1).

Theoretically formula bellow should work

Max(
    TOTAL <Dimension2,Dimension3>
    Aggr(
        Sum(X)
        ,Dimension1,Dimension2,Dimension3))

But it shows 

Dimension1 Dimension2 Dimension3 Measure1 Measure2

Dimension1Dimension2Dimension3Measure1Measure2
1Ai10100
2Ai100100
3Aq30100
4Bq4040
5Bd3040
6Bd3040


I could expect such a result with the formula

Max(
    TOTAL <Dimension2>
    Aggr(
        Sum(X)
        ,Dimension1,Dimension2,Dimension3))

So the formula part "TOTAL <Dimension2,Dimension3> " doesn't work as I expect.

A workaround works for me - to add next formula as a dimension

Aggr(
    Max(
        Aggr(
            Sum(X)
            ,Dimension1,Dimension2,Dimension3))
    ,Dimension2,Dimension3)

But the question is still actual:

why the Total part of the formula doesn't make aggregation grouping it with all needed dimensions?

Max(
    TOTAL <Dimension2,Dimension3>
    Aggr(
        Sum(X)
        ,Dimension1,Dimension2,Dimension3))

 

 

 

 

 

Labels (1)
1 Reply
Ksrinivasan
Specialist
Specialist

hi,

can you share real result table. what you have expected,

ksrinivasan