
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
SUM IF- how to write an expression to achieve SUM IF in Qlik
Hello- I have a table in Qlik Sense that I want to use as part of a bar chart. I want the chart to display 2 bars:
1). The SUM of the Service Hours for column 'Service.Is No Show' = No (i.e. time attended)
2). The SUM of the Service Hours for column 'Service.Is No Show' = Yes (i.e. time missed)
In excel, this would be a SUM IF function. How do I write an expression in Qlik to achieve this result?
In the snapshot below, the 2 bars would display:
14 Hours YES
35 Hours NO
Everything I have tried so far just gives me the COUNT of rows with a NO, not the sum of the Service Hours with that condition.
Any help is greatly appreciated!
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@AO1 If you add [Service.Is No Show] as dimension in bar chart, and measure as sum([Sevice Hours]) would be enough to get what you want.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1. SUM({$<[Service.Is No Show] = {'No'}>}[Service Hours])
2. SUM({$<[Service.Is No Show] = {'Yes'}>}[Service Hours])

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@AO1 If you add [Service.Is No Show] as dimension in bar chart, and measure as sum([Sevice Hours]) would be enough to get what you want.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you! I had tried a variation of that expression but kept getting an error.
I copied what you posted over and am getting the 'error in expression'.
Am I missing something?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you so much!! That worked for me!


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
what dims you have? you have to replace the fields in the expression with your original field names.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@AO1 Please accept the solution if that helped

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My dimension was for Program Name, which is one of my columns in the Table.
