Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

help with aggregation

Hi,

My table chart shows wrong values ( Month, Feb)  149 when it is expanded.

when i choose only Feb the expression is correct.  139

variable:

=Day(MonthEnd(Max(Dato)))

Expression:

sum({<PRISTABID={'745'}>} distinct ELEMENTPRIS/366*vDaysMonth)

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

solved it;

aggr(Day(MonthEnd(Max(Dato))),Måned,Kontraktsgruppenavn, Målepunktid))

View solution in original post

15 Replies
migueldelval
Specialist
Specialist

Hi Marius,

Try this expression:

=(sum({<PRISTABID={'745'}>} ELEMENTPRIS)/366)*vDaysMonth

Regards

Miguel del Valle

Anonymous
Not applicable
Author

Not correct..

now i got this output:

the one to the left is correct, but the feb month shows 149 when it should show 139.

when i select only february it shows 139

migueldelval
Specialist
Specialist

Hi Marius,

What kind of master calendar are you using?

Regards

Miguel del Valle

Anonymous
Not applicable
Author

Not sure, i have used the same for several years.. script file.

i thing the problem is my variable or something..

migueldelval
Specialist
Specialist

Hi Marius,

I think that it´s good always use a master calendar to handdle days/month/year.

You can make a new field in your script with days of each month.

If you attach an example I would help you.

Regards

Miguel del Valle

Anonymous
Not applicable
Author

se attached.

my variable dosent aggregate between months so it uses only 31 for all months when the table shows jan-des.

Anonymous
Not applicable
Author

solved it;

aggr(Day(MonthEnd(Max(Dato))),Måned,Kontraktsgruppenavn, Målepunktid))

migueldelval
Specialist
Specialist

Perfect Marius,

But red this article, I think that could be interesting for you.

Calendars

Regards

Miguel del Valle

Anonymous
Not applicable
Author

Thanks

One question;

i have "ELEMENTPRIS, Effektledd" for each month

01.01-01.02

01.02-01.03

01.03-01.04 and so on.

but i only have "ELEMENTPRIS, Energiledd" with a range of several months.

01.01-01.04

01.04-01.09

how can i create Elementpris, Energiledd for each month ?