Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
yvonne-c
Creator
Creator

Expression to Calculate average

Hi,

I am trying to calculate the  average figure from the attached  chart to go in a text box

This is the expression used in my chart, any help on how I calculate the average figure from it?

Sum({<[Farm ID]=,[Target Weight]={600}>}Aggr(Sum({<[Farm ID]=>}Quantity)/only({<[Farm ID]=>}[Calculated Cow Course])/only({<[Farm ID]=>}[No Cows]),Product,[Farm ID]))

Thanks

1 Reply
swuehl
MVP
MVP

Would be easier to answer with more context provided, the dimensions in your chart you've used, some details about the data model, how you calculcated the average line.

Maybe (probably not the best solution) something like

=Avg(<[Farm ID]=,[Target Weight]={600}>}

     Aggr(

Sum({<[Farm ID]=,[Target Weight]={600}>}Aggr(Sum({<[Farm ID]=>}Quantity)/only({<[Farm ID]=>}[Calculated Cow Course])/only({<[Farm ID]=>}[No Cows]),Product,[Farm ID]))

, YourChartDimensionField(s)CommaSeparated

))