Qlik Community

Qlik Sense Cloud Discussions

nurulizzaty
New Contributor III

How to return numeric value in Mode function

I use Mode(ACCIDENT_TYPE) 

and it returns PROPERTY DAMAGE as the most accident type.

but how do I return along the number of how much that accidents have occurred? 

1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Re: How to return numeric value in Mode function

You could try something like this:

count(ACCIDENT_TYPE)

or maybe:

count({< ACCIDENT_TYPE = {"$(=Mode(ACCIDENT_TYPE))"}>} ACCIDENT_TYPE)

- Marcus

2 Replies
MVP & Luminary
MVP & Luminary

Re: How to return numeric value in Mode function

You could try something like this:

count(ACCIDENT_TYPE)

or maybe:

count({< ACCIDENT_TYPE = {"$(=Mode(ACCIDENT_TYPE))"}>} ACCIDENT_TYPE)

- Marcus

nurulizzaty
New Contributor III

Re: How to return numeric value in Mode function

The first syntax is invalid because it will count the total number of accident type.

but the second syntax is valid because it will count the most accident type which is the number of PROPERTY DAMAGE. 

THANK YOU SO MUCH @marcus_sommer ! 

I really appreciate your help :))))