Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Nested Aggregation in Scripting

Hi Friends,

I'm new to Qlikview and trying to work on one scenario where I'm stuck and tried to resolve that by Nested aggregation but QV is throwing me an error saying it is not allowed and please help me how to achieve it, here is the sample script of my scenario

Temp:

LOAD

    [id1], 

    [id2],

    avg([hol]) AS [Holidays],

  Resident [main_table]

    GROUP BY [id1],[id2];

   

LEFT JOIN([Temp])

LOAD

    [id1], 

  //  [id2],

    sum([Holidays]) AS [Holidays],

    Resident [Temp]

     GROUP BY [id1];

My requirement is to achieve the aggregated value of same user having worked in different areas. When I used the above code QV returning the huge values. Please find the table for your reference.

Id1Id2Holidays
101110
101110
101110
10125
10125
Result of Holidays :15

Thanks in advance.

Regards,

Sindhu.

5 Replies
MK_QSL
MVP
MVP

can you provide sample data?

Not clear what you want to achieve.

Not applicable
Author

Hi Manish,

Based on Id1 and Id2, holidays column should do average i.e (avg of 10=10) and (avg of 5=5) which I did using group by [ID1][ID2] now the averages of these should be sum(10+5=15) I did using group by only on ID1 column. But it didn't work. Hope you understand my explanation.

Thanks,

Sindhu.

MK_QSL
MVP
MVP

Can you provide sample data along with your required result?

Not asking more data but if possible at least for 4-5 ID

Not applicable
Author

Hi,

Please find the below data.

Id1Id2Holidays
101110
101110
101110
10125
1012

5

10125
10133
10133
10133
10142
10142

Consider Id1 is an emp_id and it will not change, so it will be same for all the id's in ID2 column, and the required result should be 15 (10+5+3+2).

MK_QSL
MVP
MVP

please check