Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join us at the Cloud Data and Analytics Tour! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
QlikV1
Contributor II
Contributor II

Front End Expression count if?

Hi All,

I am working with data from a service management tool. How can I count specific incident numbers?

Goal: Count INCIDENT_NUMBERS if INCIDENT_STATE = 'New' or 'In Progress' AND CREATED_DATE = TODAY OR  CREATED_DATE = TODAY -1

Note: expression must be dynamic and not the dates hardcoded

Attempts: 

1) =if(CREATED_DATE>=today()-1 or CREATED_DATE<=today()-1,count({<INCIDENT_STATE='New','In Progress','On Hold'}>} INCIDENT_NUMBERS)

2) =Count({$<INCIDENT_STATE={'New','In Progress'},CREATED_DATE{>=Today()-1<=Today()}>}INCIDENT_NUMBERS)

Thank you for your time, it's much appreciated!

Labels (3)
2 Solutions

Accepted Solutions
Kush
MVP
MVP

@QlikV1  try below

Count({$<INCIDENT_STATE={'New','In Progress'},CREATED_DATE={">=$(=date(Today()-1))<=$(=date(Today()))"}>}INCIDENT_NUMBERS)

View solution in original post

Kush
MVP
MVP

@QlikV1  may try below

 

- last 7 days (not including today and yesterday)

Count({$<INCIDENT_STATE={'New','In Progress'},CREATED_DATE={">=$(=date(Today()-7))<$(=date(Today()-1))"}>}INCIDENT_NUMBERS)

- everything in CREATED_DATE not including the last 7 days

Count({$<INCIDENT_STATE={'New','In Progress'},CREATED_DATE={"<$(=date(Today()-7))"}>}INCIDENT_NUMBERS)

View solution in original post

5 Replies
Kush
MVP
MVP

@QlikV1  try below

Count({$<INCIDENT_STATE={'New','In Progress'},CREATED_DATE={">=$(=date(Today()-1))<=$(=date(Today()))"}>}INCIDENT_NUMBERS)

View solution in original post

QlikV1
Contributor II
Contributor II
Author

Awesome! Works like a charm and I understand what I did wrong : )

QlikV1
Contributor II
Contributor II
Author

As a follow-up question, if I want the same expression but a different date range (still calculated from today's date), would I simply change the "today()" & "today()-1"?

I tried to change the values but the numbers don't add up.

Eventually, I need to count incidents for:

- today and yesterday (formula above)

- last 7 days (not including today and yesterday)

- everything in CREATED_DATE not including the last 7 days

Kush
MVP
MVP

@QlikV1  may try below

 

- last 7 days (not including today and yesterday)

Count({$<INCIDENT_STATE={'New','In Progress'},CREATED_DATE={">=$(=date(Today()-7))<$(=date(Today()-1))"}>}INCIDENT_NUMBERS)

- everything in CREATED_DATE not including the last 7 days

Count({$<INCIDENT_STATE={'New','In Progress'},CREATED_DATE={"<$(=date(Today()-7))"}>}INCIDENT_NUMBERS)

View solution in original post

QlikV1
Contributor II
Contributor II
Author

You are amazing, thanks!!