Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
viveksairam89
Creator
Creator

pivot table grand total Problem

   

rankNameitemMonthJanFebMarJunAugGrand Total
2abc123 1.5703.400.501.476.93
7cdf456 01.1400081.63
8qwe789 081.630001.14
Total 1.5741.393.400.501.4714.95 should come

Can any one help me only the highlighted in red color should calculate and total should be 1.57+1.14+81.63+3.40+0.50+1.47/6=14.95

other totals are correct month wise

used expression:

avg(Aggr(DISTINCT sum(Value)/Count(if(Name<>0,Name,Month)), Name))

Regards

vivek

1 Solution

Accepted Solutions
viveksairam89
Creator
Creator
Author

Hi all,

Using this expression we can achieve this output

Sum(Aggr(Avg(value), month, item))/ Sum(Aggr(Count(DISTINCT  {<value -= {'0'}>} item),item,month))

 

 

rank
itemMonthJanFebMarJunAugGrand Total
2abc1231.5703.40.51.471.73
7cdf45601.140001.14
8qwe789081.6300081.63
Total 1.5741.393.40.51.4714.95

View solution in original post

7 Replies
sunny_talwar

May be attach a sample to look at if possible.

veidlburkhard
Creator III
Creator III

Hi vivek,

please use the below expression and you will get your favored result.

If(Dimensionality() = 0, Sum(Aggr(DISTINCT sum(Value), item, Month))/Count(if(Value<>0,Month)), Sum(Value))

Hope this helps.

Burkhard

viveksairam89
Creator
Creator
Author

@Sunny T

     i have attached the sample QVW

Thanks

viveksairam89
Creator
Creator
Author

Hi,

Can you help me out I have attached the sample QVW and attached screen shot

Iam not getting the exact grand total 14.95

Thanks

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try this expression

If(RangeMax(Dimensionality(), SecondaryDimensionality()) = 0,

Sum(TOTAL value)/Sum(Aggr(If(Sum(value) > 0, 1, 0), month, item, Name, rank)), Sum(value))

I think it is 15.58.

Regards,

jagan.

viveksairam89
Creator
Creator
Author

Hi

I am not getting the corret answer for grand total and inside the dimension values also changed using the expression

can you help me out by seeing the attached screen shot and qvw to help to understand better

Thanks in advance

viveksairam89
Creator
Creator
Author

Hi all,

Using this expression we can achieve this output

Sum(Aggr(Avg(value), month, item))/ Sum(Aggr(Count(DISTINCT  {<value -= {'0'}>} item),item,month))

 

 

rank
itemMonthJanFebMarJunAugGrand Total
2abc1231.5703.40.51.471.73
7cdf45601.140001.14
8qwe789081.6300081.63
Total 1.5741.393.40.51.4714.95