Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Adding up columns where a condition is met

Hi

Im having trouble with this as im very new to Qlikview

I want to add up the number of times a word appears in my selected fields

Count({<EmployeeGradeDescription1={'Home Administrator'}>}[EmployeeCode])

If i do this i get 1, where it appears once, but there are 3 other fields EmployeeGradeDescription2, EmployeeGradeDescription3, EmployeeGradeDescription4 where it could appear and to get the total i thought i could do this


Count({<EmployeeGradeDescription1={'Home Administrator'}>}[EmployeeCode]) + Count({<EmployeeGradeDescription2={'Home Administrator'}>}[EmployeeCode]) + Count({<EmployeeGradeDescription3={'Home Administrator'}>}[EmployeeCode]) + Count({<EmployeeGradeDescription4={'Home Administrator'}>}[EmployeeCode])


or


=Count({<EmployeeGradeDescription1={'Home Administrator'}>}[EmployeeCode])

Count({<EmployeeGradeDescription2={'Home Administrator'}>}[EmployeeCode])

Count({<EmployeeGradeDescription3={'Home Administrator'}>}[EmployeeCode])

Count({<EmployeeGradeDescription4={'Home Administrator'}>}[EmployeeCode])


But dont seem to give me the correct answer


How do you do this calculation to add up the total of the four fields where "Home Administrator" appears?


Dan

1 Reply
andrei_delta
Partner - Creator III
Partner - Creator III

Hello

you can write it like this also


Count({<EmployeeGradeDescription1={'Home Administrator'}> + <EmployeeGradeDescription2={'Home Administrator'}> + <EmployeeGradeDescription3={'Home Administrator'}> + <EmployeeGradeDescription4={'Home Administrator'}>}[EmployeeCode])


or


Count({<EmployeeGradeDescription1={'Home Administrator'},EmployeeGradeDescription2={'Home Administrator'}> ,EmployeeGradeDescription3={'Home Administrator'},EmployeeGradeDescription4={'Home Administrator'}>}[EmployeeCode])