# QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

## ValueList and aggr

Hello,

I really need your help with ValueList and aggr function.

I have table with power usage and want to give out the KW and the KwH per phase . We have 3 phases.

My ValueList: =ValueList('Phase 1','Phase 2','Phase 3', 'Summe')

My actual expression for KW is:

if(ValueList('Phase 1','Phase 2','Phase 3','Summe')='Phase 1',

sum(aggr(avg(phase1_avg),PDU1)),
if(ValueList('Phase 1','Phase 2','Phase 3','Summe')='Phase 2',

sum(aggr(avg(phase1_avg),PDU1)),
if(ValueList('Phase 1','Phase 2','Phase 3','Summe')='Phase 3',

sum(aggr(avg(phase1_avg),PDU1)),
if(ValueList('Phase 1','Phase 2','Phase 3','Summe')='Summe',
sum(aggr(avg(phase1_avg),PDU1))
+
sum(aggr(avg(phase1_avg),PDU1))
+
sum(aggr(avg(phase1_avg),PDU1))
))))

For KW in phase 2 and 3 I only get 0-Values. It just show the same values like in phase 1.

When I try with NODISTINCT I get no the right results.

Just for example I used for all ValueList-Options the phase1_avg.

In the real application I will get different values for phase 1, phase 2 and phase 3.

Do you have any idea?

Best regards
Sabine

1 Solution

Accepted Solutions
MVP

3 Replies
MVP

Not applicable

Hi Sunny,