Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Read about the latest Qlik Community enhancements on the Community News blog!
cancel
Showing results for 
Search instead for 
Did you mean: 
laupama
Partner
Partner

Sum(if Year problem

Hi,

I have a problem with a sum if condition.

If i just take Months it works:

=sum(IF([Llamadas.Dia.autoCalendar.Month]=(Month(AddMonths(today(),-1))),Recibidas))

If i take Years it doesn't work:

=sum(IF([Llamadas.Dia.autoCalendar.Year]=(Year(AddMonths(today(),-1))),Recibidas))

 

I don't know why it's working like this.

 

I take an screenshoot with booth conditions, and the result of "[Llamadas.Dia.autoCalendar.Year]" and "(Year(AddMonths(today(),-1))"

 

Example

Labels (2)
1 Solution

Accepted Solutions
Lisa_P
Employee
Employee

Use set analysis:

=sum({<[Llamadas.Dia.autoCalendar.Month]={$(=Month(AddMonths(today(),-1))}>}Recibidas)

 

=sum({<[Llamadas.Dia.autoCalendar.Year]={$(=Year(AddMonths(today(),-1))}>}Recibidas)

View solution in original post

2 Replies
Lisa_P
Employee
Employee

Use set analysis:

=sum({<[Llamadas.Dia.autoCalendar.Month]={$(=Month(AddMonths(today(),-1))}>}Recibidas)

 

=sum({<[Llamadas.Dia.autoCalendar.Year]={$(=Year(AddMonths(today(),-1))}>}Recibidas)

View solution in original post

laupama
Partner
Partner
Author

Hi Lisa_P,

it works!

Thank you so much.

 

Finally I have booth conditions working: 

=sum({<[Llamadas.Dia.autoCalendar.Year]={$(=Year(AddMonths(today(),-1)))},[Llamadas.Dia.autoCalendar.Month]={$(=Month(AddMonths(today(),-1)))}>}Recibidas)