Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
darrinturner
Contributor II
Contributor II

Summing with if conditions

Hello all,

I was hoping someone would help me with a challenge I am facing.

I am trying to sum ActualVolume for Where _Calendar_RollMonthSort is not 13 and CalendarYear  is not 2019 and right(Calendar_RollMonthName,1) is not 'A'.

Example If([_Calendar_RollMonthSort] <> '13' AND CalendarYear <> 2019 AND right(Calendar_RollMonthName,1) <> 'A', SUM({<CalendarCurrRolling13Mo={1}>}ActualVolume)/1000)

However it is not working as planned as it looks at [_Calendar_RollMonthSort] <> '13'  and excludes both records. Then the next part  "CalendarYear <> 2019 " excluded all with the year 2019 ect.

 

qlik exp1.PNG

 

I need it to only exclude if all conditions are true.

Your help would be appreciated

 

 

4 Replies
darrinturner
Contributor II
Contributor II
Author

I have also tried using: SUM({<CalendarCurrRolling13Mo={1}, _Calendar_RollMonthSort] -= {'13'}, CalendarYear -= {'2019'} , Right([_Calendar_RollMonthName],1) -= {'A'}>} _ActualVolume)/1000

 

With no luck

Kushal_Chawda

try below

 

SUM({<CalendarCurrRolling13Mo={1},[_Calendar_RollMonthSort]-={'13'},CalendarYear-={2019} , Calendar_RollMonthName={"=right(Calendar_RollMonthName,1) <> 'A'"}>}ActualVolume)/1000

 

darrinturner
Contributor II
Contributor II
Author

Kush, thank you for the code. However I loos records I don't want to lose.

 

In the image below, I have highlighted the record I actually want to exclude:

qlik exp2.PNG

Kushal_Chawda

Would you be able to share sample?