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: 
Anonymous
Not applicable

Bottom Up sum in my pivot table for the expression

Hi Experts,

I have below final table in Pivot table format,for the country Dimension I have value Expression for each stage.We need need bottom up sum for each country and need total at the extreme End

EUROPEEUROPEIndiaIndia
DateValueDateValue
Stage19/8/201709/8/20170
Stage29/13/201709/13/20170
Stage39/18/2017109/18/20170
Stage49/20/201799/20/20170
Stage59/21/201789/21/20170
Stage69/22/201769/22/201710
Stage79/22/201749/22/20179
Stage89/20/201729/20/20178
Stage99/22/201719/22/20176

Below output We are expecting,

For India from stage9 to Stage1 sum up

1=Stage9

3(1+2)=Stage8

7(1+2+4)=Stage7 etc.,,


and Total at the extreme end is 40 for Europe 31 for India

EUROPEEUROPEIndiaIndia
DateValueDateValue
Stage19/8/2017409/8/201731
Stage29/13/2017409/13/201731
Stage39/18/2017409/18/201731
Stage49/20/2017309/20/201731
Stage59/21/2017219/21/201731
Stage69/22/2017139/22/201731
Stage79/22/201779/22/201721
Stage89/20/201739/20/201713
Stage99/22/201719/22/20176
Total4031

Could you please help me out to achieve the desired out put .

In-Advance

Thank you

1 Solution

Accepted Solutions
sunny_talwar

Seems like Antonio's solution works

If(Dim2 = 'Ende',

WeekDay(Ende) & ' ' &date(aggr(max(Ende),Supplier,Stage)),

If(Dim2 = 'Seiten',

RangeSum(Bottom(FirstSortedValue(Aggr(Sum(Seiten),Supplier,Stage,Dim2,Ende),-Aggr(Max(Ende),Supplier,Stage, Dim2,Ende)), 1, NoOfRows(TOTAL)- RowNo(Total)+1))

))

Capture.PNG

View solution in original post

14 Replies
sunny_talwar

May be this

Sum(TOTAL <Country> Value) - RangeSum(Above(Sum(Value), 1, RowNo()))

sunny_talwar

To get the totals, you can try this

If(Dimensionality() = 0, Sum(Value), Sum(TOTAL <Country> Value) - RangeSum(Above(Sum(Value), 1, RowNo())))

Anonymous
Not applicable
Author

Tried above expression but no luck,may be I'm placing in a wrong way.

My current expression is

If(Dim2 = Date

WeekDay(Date) & ' ' &date(aggr(max(Date),Country,Stage)),

If(Dim2 = 'Value',

FirstSortedValue(Aggr(Sum(Value),Country,Stage,Dim2,Date),-Aggr(Max(Date),Country,Stage, Dim2,Date))

))

Dimensions :Stage,Country,Dim2

Aggregations Measures : Date,Value


please help me to sort out

sunny_talwar

Would you be able to share a sample qvw to look at this?

Anonymous
Not applicable
Author

PFA

sunny_talwar

What is the expected output here?

antoniotiman
Master III
Master III

Hi Satya,

try this

RangeSum(Bottom(TOTAL  EUROPEValue,1,NoOfRows(TOTAL)- RowNo(Total)+1))

Regards,

Antonio

Anonymous
Not applicable
Author

First of thanks for the prompt response.For the attached sample I have added note for the expected output.

sunny_talwar

Seems like Antonio's solution works

If(Dim2 = 'Ende',

WeekDay(Ende) & ' ' &date(aggr(max(Ende),Supplier,Stage)),

If(Dim2 = 'Seiten',

RangeSum(Bottom(FirstSortedValue(Aggr(Sum(Seiten),Supplier,Stage,Dim2,Ende),-Aggr(Max(Ende),Supplier,Stage, Dim2,Ende)), 1, NoOfRows(TOTAL)- RowNo(Total)+1))

))

Capture.PNG