Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
icaro_povoa
Contributor II
Contributor II

Agr

Dear all,

I am quite new in Qlik and I am suffering to get an calculation done.

I work with planning , and need to check the accuracy of my production by season & Hybrid in absolut numbers.


Below an example.

I need to Sum variation of each hybrid.

EX: Hybrid 1: (-2+5)=3

       Hybrid 2: (+4-5)=-1

       Hybrid X.......

The point is that I don´t want to have a table to calculate this number. I wanna use a TextBox to give me the Sum (Absolute Numbers). In the example above equal to 4 on Hybrid 1 + Hybrid 2

   

SeasonHybridProduction PlanProduction ActualDifference
Season 1Hybrid 1108-2
Season 1Hybrid 210144
Season 1Hybrid 320211
Season 1Hybrid 4304-26
Season 1Hybrid 5404-36
Season 1Hybrid 646537
Season 1Hybrid 1294940
Season 2Hybrid 11015+5
Season 2Hybrid 21510-5
Season 2Hybrid 3102010
Season 2Hybrid 4103-7
Season 2Hybrid 540400
Season 2Hybrid 646460
Season 2Hybrid 1686860
Season 2Hybrid 1794940

Thank you very much for your help.

1 Solution

Accepted Solutions
sunny_talwar

Or this

=Sum(Aggr(fabs(Sum(Difference)), Hybrid))


Capture.PNG

View solution in original post

4 Replies
chrismarlow
Specialist II
Specialist II

Does this work? Aggregating first over Hybrid, then taking the absolute & then the season?

=sum(aggr(sum(fabs(aggr(sum([Production Actual]-[Production Plan]),[Hybrid]))),[Season]))

Regards,

Chris.

sunny_talwar

May be this in a text box object

Sum(Aggr(fabs(Sum([Production Actual] - [Production Plan])), Hybrid))

sunny_talwar

Or this

=Sum(Aggr(fabs(Sum(Difference)), Hybrid))


Capture.PNG

icaro_povoa
Contributor II
Contributor II
Author

Thank you very much! It worked perfectly!!

Regards