Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
Id1 | Id2 | Holidays |
---|---|---|
101 | 1 | 10 |
101 | 1 | 10 |
101 | 1 | 10 |
101 | 2 | 5 |
101 | 2 | 5 |
Result of Holidays :15 |
Thanks in advance.
Regards,
Sindhu.
can you provide sample data?
Not clear what you want to achieve.
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.
Can you provide sample data along with your required result?
Not asking more data but if possible at least for 4-5 ID
Hi,
Please find the below data.
Id1 | Id2 | Holidays |
---|---|---|
101 | 1 | 10 |
101 | 1 | 10 |
101 | 1 | 10 |
101 | 2 | 5 |
101 | 2 | 5 |
101 | 2 | 5 |
101 | 3 | 3 |
101 | 3 | 3 |
101 | 3 | 3 |
101 | 4 | 2 |
101 | 4 | 2 |
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).
please check