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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Aggregation problem ...

Hi, please refer to the following data set and the formula to calculate the revenue. Attached herewith is my Qlikview application. My problem is when i selecting a company, there is no any output. Kindly please help me to fix the bug. Thanks much.


YEAR 2011
-----------------

company_code   fiscal_year     revenue
1                         2011              10/20 = 0.5
2                         2011              30/40 = 0.75
3                         2011              50/60 = 0.83

Average revenue for year 2011 = (0.5 + 0.75 + 0.83) / 3 = 0.69


YEAR 2010
----------------

company_code    fiscal_year     revenue
1                          2010              70/80 = 0.88
2                          2010              90/100 = 0.9
3                          2010              110/120 = 0.92

Average revenue for year 2010 = (0.88 + 0.9 + 0.92) / 3 = 0.9

1 Solution

Accepted Solutions
lironbaram
Partner - Master III
Partner - Master III

hei

i made two changes one i used the e() function in your set analysis

seconed you need to put yuor set analysis expression in the avg function also

see attach example

View solution in original post

5 Replies
lironbaram
Partner - Master III
Partner - Master III

hei

i made two changes one i used the e() function in your set analysis

seconed you need to put yuor set analysis expression in the avg function also

see attach example

SunilChauhan
Champion II
Champion II

see the attached file

hope this helps

Sunil Chauhan
Not applicable
Author

Hi Liron, you are brilliant! Thanks so much! Would you mind to explain to me why it is needed to put the set analysis in the AVG function? And why only the set analysis for nominator needs to be put in the AVG function? Thanks.

Not applicable
Author

Thank you Sunil

llauses243
Creator III
Creator III

Hi,

I'm confused w the solution Liron & Sunil, plsto see attach ...

What is ok?

Very thx, Luis