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

Announcements
Streamlining user types in Qlik Cloud capacity-based subscriptions: Read the Details
cancel
Showing results for 
Search instead for 
Did you mean: 
JoseGarcia
Creator III
Creator III

summing counts

hi there, 

trying to sum a result of three count. Using formula below, but got an error somewhere.
Could anyone help?
Thanks a million

=Count({<Action1_Status= {'In-Progress'}>} +
Count({<Action2_Status= {'In-Progress'}>} +
Count({<Action3_Status= {'In-Progress'}>}
ListItemsFromID_id)

Labels (1)
2 Solutions

Accepted Solutions
Dalton_Ruer
Support
Support

You need each count operation to be a standalone value. 

Count({<Action1_Status= {'In-Progress'}>}  ListItemsFromID_id) +  count2 + count3

View solution in original post

GaryGiles
Specialist
Specialist

Depends on what you are trying to accomplish and the structure of your data: you can union the sets, like this:

=Count({<Action1_Status= {'In-Progress'}>+<Action2_Status= {'In-Progress'}>+<Action3_Status= {'In-Progress'}>}
ListItemsFromID_id)

or have 3 count functions, like this:

=Count({<Action1_Status= {'In-Progress'}>} ListItemsFromID_id) +
Count({<Action2_Status= {'In-Progress'}>} ListItemsFromID_id) +
Count({<Action3_Status= {'In-Progress'}>}
ListItemsFromID_id)

View solution in original post

4 Replies
Dalton_Ruer
Support
Support

You need each count operation to be a standalone value. 

Count({<Action1_Status= {'In-Progress'}>}  ListItemsFromID_id) +  count2 + count3

JoseGarcia
Creator III
Creator III
Author

Thanks a million! formula worked 🙂

Dalton_Ruer
Support
Support

Or if you use those progress flags a lot, create them as flags in the load script:

IF(Action1_Status = 'In-Progress', 1, 0) as InProgress1_Flag

 

Then your expression can simply be SUM (InProgress1_Flag + InProgress2_Flag + InProgress3_Flag)

GaryGiles
Specialist
Specialist

Depends on what you are trying to accomplish and the structure of your data: you can union the sets, like this:

=Count({<Action1_Status= {'In-Progress'}>+<Action2_Status= {'In-Progress'}>+<Action3_Status= {'In-Progress'}>}
ListItemsFromID_id)

or have 3 count functions, like this:

=Count({<Action1_Status= {'In-Progress'}>} ListItemsFromID_id) +
Count({<Action2_Status= {'In-Progress'}>} ListItemsFromID_id) +
Count({<Action3_Status= {'In-Progress'}>}
ListItemsFromID_id)