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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
Master II
Master II

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

View solution in original post

4 Replies
devarasu07
Master II
Master II

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

Chanty4u
MVP
MVP

Hi,

check below link it is also helpful to you

Re: greater than value

sunny_talwar

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

Anonymous
Not applicable
Author

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