Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
jkonicki
New Contributor

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

Re: Count Mathematical Expressions

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)

3 Replies

Re: Count Mathematical Expressions

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)

MVP
MVP

Re: Count Mathematical Expressions

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

jkonicki
New Contributor

Re: Count Mathematical Expressions

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

Community Browser