Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count If function

Hi All,

This might seem as a very basic question, but I am trying to figure out a formula that will count the number of days that show an aging of 90-120 days old.

Count(if[Aging Days].......

Thanks,
Charles

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Use set analysis like:

Count({<[Aging Days]={'>=90<=120'}>} [Aging Days])

View solution in original post

8 Replies
carolin01
Luminary Alumni
Luminary Alumni

Hi,

Are you trying to do this within a script or a chart? It´s often said that for performance reason it´s better to do this within the script and then you would create a new colum:

if(AgingDays                    > '90',         ‘0',
      if(AgingDays              < '90',         '1',

           if(AgingDays         < '120',        '0'))) as AgingDaysCount


Then within your chart you can use Sum(AgingDaysCount)


I hope this helps.

carolin01
Luminary Alumni
Luminary Alumni

You can also use <=90 and <=120.

tresesco
MVP
MVP

Use set analysis like:

Count({<[Aging Days]={'>=90<=120'}>} [Aging Days])

jagan
Luminary Alumni
Luminary Alumni

Hi

You can easily achieve this by using Set Analysis, which has better performance than IF()

=Count({<AgingDays={'>=90<=120'}>} SomeDimensionName)

Hope this helps you.

Regards,

jagan.

Not applicable
Author

Thanks tresesco!

This formula worked!

Not applicable
Author

Thanks all for the fast response and support. i got the answer I needed.

paul_scotchford
Specialist
Specialist

In addition, you can explore the Class() function (used in the loader) very handy for banding your age range data.

jagan
Luminary Alumni
Luminary Alumni

Hi,

If you got the Answer please close this thread by giving Correct and Helpful answers to the posts which helps you in getting the answer.

Regards,

Jagan.