Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
Jan_Wilmsen
New Contributor

Chart Row expression vs Totals Mode issue

Dears,

I hope the screenshot is self explaining.

My expression for column C is simply deviding 2 columns A and B by eachother 

The Total lines of column A and B are set to sum.

How to get the Total line of C to match the total of A / total of B.

I have tried with sum aggr total... but fail to get the result i am looking for.

thanks,

Jan

Screenshot - 4_29_2019 , 12_45_54 PM.png

1 Solution

Accepted Solutions
Highlighted
kushalthakral
Contributor III

Re: Chart Row expression vs Totals Mode issue

Hi 

Can you please use the expression below

=If(Dimensionality() = 0,Sum(Total Aggr(SUM({<Type={'SCRAP'}>}Qty)*Price,Part,Coef)) / Sum(Total Aggr((SUM({<Type={'Produced'}>}Qty) - SUM({<Type={'SCRAP'}>}Qty))*Coef,Part,Coef)),SCRAPPRICE/OKCOEF)

 

Thanks

Kushal

View solution in original post

13 Replies
Highlighted
Partner
Partner

Re: Chart Row expression vs Totals Mode issue

Your screen shot is corrupted. Upload a new one.

From my understanding, you can use Expression total or sum of rows in Expression tab Total Mode option.

You Know What To Do.
Highlighted
Jan_Wilmsen
New Contributor

Re: Chart Row expression vs Totals Mode issue

Does this work ?QV_Chart_Totals.png

Highlighted
Partner
Partner

Re: Chart Row expression vs Totals Mode issue

Instead of sum of Rows. Use the Above option Expression Total

You Know What To Do.
Highlighted
Jan_Wilmsen
New Contributor

Re: Chart Row expression vs Totals Mode issue

I tried "Expression Total" already.

Its resulting in a '-' as total.

Exp_Total.png

Highlighted
Jan_Wilmsen
New Contributor

Re: Chart Row expression vs Totals Mode issue

Adding a simplified QVW

How to get the totals of A/B --> 11/8 = 1.375

Screenshot - 4_29_2019 , 5_11_56 PM.png

 

Highlighted
Partner
Partner

Re: Chart Row expression vs Totals Mode issue

Is this what you want?

Also you can use Column(1)/Column(2)

You Know What To Do.
Highlighted
Jan_Wilmsen
New Contributor

Re: Chart Row expression vs Totals Mode issue

Unfortunately real life is a bit more complex than the example i attached previously.

I tried to make my demo qvw 1 step closer to what i have in reality... 

Putting the SUM(A)/SUM(B) as you proposed is returning "-" in the sample attached same as it does in my real life scenario.

See attached.

Screenshot - 4_30_2019 , 10_54_26 AM.png

 

Highlighted
Jan_Wilmsen
New Contributor

Re: Chart Row expression vs Totals Mode issue

(SUM({<Type={'SCRAP'}>}Qty)*Price)/((SUM({<Type={'Produced'}>}Qty)-SUM({<Type={'SCRAP'}>}Qty))*Coef)

This is the last expression fully written down.
If i add Sum function around nominator and denominator
SUM(SUM({<Type={'SCRAP'}>}Qty)*Price)/SUM((SUM({<Type={'Produced'}>}Qty)-SUM({<Type={'SCRAP'}>}Qty))*Coef)
the entire table goes blank... you can try on the demo2.qvw attached in post above.
Challenge remains to get the totals of the last column to match this expression.
Highlighted
kushalthakral
Contributor III

Re: Chart Row expression vs Totals Mode issue

Hi Jan

 

you can use below expression for the attached qvw

If(Dimensionality() = 0,sum( total A)/sum(total B),Sum(A)/Sum(B))

 

Thanks

Kushal