Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor II
Contributor II

Count Mathematical Expressions

Hello,

I am trying to add a condition to my count statement in order to factor in if an amount is in between two others. The conditions go as this:

1. The CERTIFICATION_EXPIRATION DATE must NOT be null or zero.

2. The CERTIFICATION_EXPIRATION DATE minus vToday(Today's date) must be greater than or equal to 1 and less than or equal to 30.

If these conditions are met, RTC_TITLE is to be counted. This is what I have so far with no luck:

count( {$<CERTIFICATION_EXPIRATION_DATE -= {''}, CERTIFICATION_EXPIRATION_DATE -= {0} , CERTIFICATION_EXPIRATION_DATE-vToday = {"<=$(=(30))", ">=$(=(1))"}>} RTC_TITLE)

Any help is appreciated!

Thanks!

1 Solution

Accepted Solutions
Highlighted

I believe your third condition should take care of the first two:

=Count({$<CERTIFICATION_EXPIRATION_DATE = {"=(CERTIFICATION_EXPIRATION_DATE - vToday) <=30 and (CERTIFICATION_EXPIRATION_DATE - vToday) >=1"}>} RTC_TITLE)

View solution in original post

3 Replies
Highlighted

I believe your third condition should take care of the first two:

=Count({$<CERTIFICATION_EXPIRATION_DATE = {"=(CERTIFICATION_EXPIRATION_DATE - vToday) <=30 and (CERTIFICATION_EXPIRATION_DATE - vToday) >=1"}>} RTC_TITLE)

View solution in original post

Highlighted
MVP
MVP

You should use only a single set modifier for CERTIFICATION_EXPIRATION_DATE. I think, if 2. is met, also 1. is met.

Only field names left of the equal sign, no expressions (which need to go into the advanced search):

count( {$<CERTIFICATION_EXPIRATION_DATE = {">=$(=Date(Today()+1))<=$(=Date(Today()+30))"}>} RTC_TITLE)


You may need to add a date() format code to match the format of CERTIFICATION_EXPIRATION_DATE

Highlighted
Contributor II
Contributor II

This is wonderful and works great as always Sunny! I'm just trying to feed too much in the equation and overthinking it.

Appreciate the help as always!

-Jordan