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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Issue need help

Hi All,

I want to calculate the year wise average/sum of salary . I used year as dimension and

below expression in Expression:-

Avg(SALARY)

But..even after doing this i am getting same salary row wiese in every year row ...

Year       Salary

2010       32000

2011       32000

please help me in this regards:---

Sarfaraz

13 Replies
kogasawara
Partner - Creator
Partner - Creator

I cheacked your attached qvw file(setAnalysisTask.qvw).

In your qvw, two tables does not link.

Could you modify load script? like below


---------------------------------------------

Empp:

LOAD ADDRS,

     BIRTH_DATE,

     Year(START_DATE) as year,

     D_NO,

     FIRST_NAME,

     LAST_NAME,

     SALARY,

     SEX,

     SSN,

     START_DATE,

     SUPERSSN

FROM

---------------------------------------------


You need to get the year from Empp table.


Expression:

Avg(Aggr(SUM(SALARY),year))

Not applicable
Author

still i am getting same calculation ....

Year   Average salary

2010   15800

2011   15800            like this...

sarfaraz

Not applicable
Author

Thanks Kogasawar and all ...i got the solution,

Sarfaraz

MK_QSL
MVP
MVP

as per my solution below should work

Create a Straight Table

Use below as Calculated Dimension

=Aggr(Year(Date(Floor(Timestamp#(START_DATE)))),START_DATE)

Expression

AVG(SALARY)