Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

leongwaimeng
New Contributor II

Count of values (Greater than or lesser than)

Hi all,

I have a field(TOTAL GOALS) which has values 1, 2, 3, 4, 5, 6, 7, ....

How do I create in a simple table, a column which counts the number of times TOTAL GOALS is:

>0.5,

<0.5,

>1.5,

<1.5

etc...

Thanks in advance!

Regards,

Wai Meng

1 Solution

Accepted Solutions
devarasu07
Honored Contributor II

Re: Count of values (Greater than or lesser than)

Hi

Can you share your expected result and elobrate bit. thanks

you have try like below nested if

if(TOTAL_GOALS >0.5, Count( TOTAL_GOALS),

if(TOTAL_GOALS <0.5, Count( TOTAL_GOALS),

if(TOTAL_GOALS >1.5, Count( TOTAL_GOALS),

if(TOTAL_GOALS <1.5, Count( TOTAL_GOALS)))))

or set expression like below

=Count({<TOTAL_GOALS = {">0.5"} >} DISTINCT TOTAL_GOALS)

Thanks,Deva

4 Replies
devarasu07
Honored Contributor II

Re: Count of values (Greater than or lesser than)

Hi

Can you share your expected result and elobrate bit. thanks

you have try like below nested if

if(TOTAL_GOALS >0.5, Count( TOTAL_GOALS),

if(TOTAL_GOALS <0.5, Count( TOTAL_GOALS),

if(TOTAL_GOALS >1.5, Count( TOTAL_GOALS),

if(TOTAL_GOALS <1.5, Count( TOTAL_GOALS)))))

or set expression like below

=Count({<TOTAL_GOALS = {">0.5"} >} DISTINCT TOTAL_GOALS)

Thanks,Deva

sureshqv
Esteemed Contributor III

Re: Count of values (Greater than or lesser than)

Hi,

check below link it is also helpful to you

Re: greater than value

MVP
MVP

Re: Count of values (Greater than or lesser than)

May be use a Valuelist function like this

Dimension

ValueList('>0.5', '<0.5', '>1.5', '<1.5')

Expression

Pick(Match(ValueList('>0.5', '<0.5', '>1.5', '<1.5'), '>0.5', '<0.5', '>1.5', '<1.5'),

Count({<[TOTAL GOALS] = {'>0.5'}>}[TOTAL GOALS]),

Count({<[TOTAL GOALS] = {'<0.5'}>}[TOTAL GOALS]),

Count({<[TOTAL GOALS] = {'>1.5'}>}[TOTAL GOALS]),

Count({<[TOTAL GOALS] = {'<1.5'}>}[TOTAL GOALS]))

leongwaimeng
New Contributor II

Re: Count of values (Greater than or lesser than)

Hi Devarasu,

Sorry for the late reply.

The below works well totally.

=Count({<TOTAL_GOALS = {">0.5"} >} DISTINCT TOTAL_GOALS)


As for the rest, thanks for your suggestions and help as always!


Regards,

Wai Meng