Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Total and average in same table

Hi all

Probably i have an easy question

i would like to have in the same table total and average, (inside the tab expression i can choose between total or avg)

example

Article Price Quantity

AAA 10 100

BBB 20 200

Average 15 150 How I can do this?

Total 30 300

Many Many Thanks Claudio

7 Replies
Miguel_Angel_Baeyens

Hello Claudio,

Depending on the chart you are using, try (untested)

Avg(Price)
or likewise with Quantity. Is that what you are looking for?

Not applicable
Author

Hi Miguel,

thank you for your answer but this is not the solution that I would like.

( I have 20 expression and using this metod I have create other 20 expression).

i would like to have the avg on all expression,

On the left i have the dimension and on top the expression.

Inside the tab expression you can choose only one between total or average.

I would like to have for all expression both value.

Many Thanks

If i'm not clear enought, I will attach an example

johnw
Champion III
Champion III

Something like this?

if("Expression"='Total',sum(Price),avg(Price))

tabletuner
Creator III
Creator III

Hi Claudio,

Try to create 2 new expressions.

1) For average use

=numavg(Column(1),Column(2),...,Column(20))

2) For Total use

=Column(1)+Column(2)+,...,+Column(20)

I think it is preferable to use Column names instead of numbers. Use the following format:

[ColumnName1] + [ColumnName2] + etc

Good luck

Not applicable
Author

Thank you at all of you.

Probably I'have not been clear.

I would like to get both (total an avg) on each expression:

Regards

Claudio

Not applicable
Author

Guess this is not possible, because the total line is only one.

Can I suggest, instead, to create two expression for each columns and then group them two by two? So, you will still have one column for each expression, but you can change the calculation between avg and sum on the fly.

It is not exactly the same, but maybe it's acceptable for you and it is easy to do.

Otherwise, you could probably create a "dummy" dimension value and change your expressions so that in case of this value it switches the aggregation from sum to avg (untested).

Spero possa essere utile....

Ciao

Not applicable
Author

Many thanks for your replay

I feared a think like thank !

Grazie