Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
niharika1234
Creator
Creator

Set Analysis Logic

Hello,

I am struggling with a Set Analysis QlikView Logic.

I want to count the incident that has opened for more than 21 days and also the field category is populated( not null). So I have tried like this :  But not working . some syntax error. Please suggest.

count( {<{"> Incident_START_DATE + 21"}> , <{Len(Trim(CATEGORY) >0}>distinct  Incident Id)

1 Solution

Accepted Solutions
niharika1234
Creator
Creator
Author

No, If I understand correctly, incident-1,  Incident-start date - 31/10/2018, if it is open more than 21 days, means 31/10/2018 +21 days, which is 20/11/2018 and it is not closed , it will count as 1. The user wants to see the ticket which are opened more than 21 days.

Thanks,

Niha

View solution in original post

8 Replies
sunny_talwar

Is this pseudo code for your expression? The reason I ask is because your set analysis seems to be incomplete... try something like this

Count({<[Incident Id] = {"=Incident_START_DATE > Today() - 21}, CATEGORY = {"*"}>} DISTINCT [Incident Id])
niharika1234
Creator
Creator
Author

count ({<IncidentId= {"> Incident_START_DATE + 21"}, {Len(Trim(CATEGORY_Final)) > 0} DISTINCT IncidentId)

 

I have modified the logic to above still some error. Please suggest.

sunny_talwar

Because the syntax still isn't right. I think you should take a step back and understand the set analysis syntax. This is a good place to start on this

A Primer on Set Analysis

niharika1234
Creator
Creator
Author

Hello Sunny,
Thanks.
Count({<[MOR_IncidentId] = {"=Incident_START_DATE > Today() - 21}, CATEGORY = {"*"}>} DISTINCT [MOR_IncidentId] )
I tried according your suggestion but some error.
1. Again ,the MOR_IncidentId should be the incident which are opened more than 21 days from Incident Start date. That means if incident opened on 31/11/2018, and if it is opened for 21 days . means '31/11/2018' + 21 days and category is not null , then count that as 1 . Please suggest.
sunny_talwar

My bad, I missed a double quote and changed the sign from > to < for Incident_START_DATE... try this

Count({<[Incident Id] = {"=Incident_START_DATE < Today() - 21"}, CATEGORY = {"*"}>} DISTINCT [Incident Id])

@niharika1234 wrote:
 Again ,the MOR_IncidentId should be the incident which are opened more than 21 days from Incident Start date. 

Compared to what? Comparing it today right? So, if an Incident opened more than 21 days ago, then show it, right?

niharika1234
Creator
Creator
Author

No, If I understand correctly, incident-1,  Incident-start date - 31/10/2018, if it is open more than 21 days, means 31/10/2018 +21 days, which is 20/11/2018 and it is not closed , it will count as 1. The user wants to see the ticket which are opened more than 21 days.

Thanks,

Niha

niharika1234
Creator
Creator
Author

Untitled.pngI should get Facility , 'MOR_CATEGORY-Final' should populate, but I do see some - spaces . And also   from Incident_START _DATE  if an incident stay for more than 21 days it should count as 1.  In the expression , third row, start date - end date is only 4 days but counting as 1, which is incorrect. In some incident , there may not be Incident End date, example the incident start date is 11/15/2018( Nov 2018) and it may not have an end date yet , since it is opened >21 days it will count as 1 also. 

Regards,

Niharika

niharika1234
Creator
Creator
Author

Hello,

Again some modification of the requirement.

count({< MOR_CATEGORY_Final = {"*-*"}, [MOR_IncidentId] = {">[Incident_START_DATE_21days]"} >} DISTINCT [MOR_IncidentId])

 In this analysis, there is some error in Date Part.  I want to see the incident that are '-' in MOR_CATEGORY_Final  and open more than 21 days.  I created a new field [Incident_START_DATE_21days] and want to see incident open above that day. the above value returning zero.

Thanks,

Niha