Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
danschofield1
New Contributor

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
Highlighted
Partner
Partner

Re: Adding up columns where a condition is met

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])