[Gelöst] Quick Filter mit Bedingung

Post Reply
andy_m42
Posts: 81
Joined: 02. Oct 2014, 14:04
Contact:

[Gelöst] Quick Filter mit Bedingung

Post by andy_m42 » 01. Sep 2017, 11:59

Hi,

ich bin mir nicht sicher wie ich hier vorgehen kann.

Wir haben nun bei uns die Aktivitäten Aufgaben, Störungen, Probleme und Änderungen in einen Tabulator "Mein Arbeitsplatz" zusammengefasst.

Wenn dieser Tabulator ausgewählt wird, sollen jegliche offene Aktivitäten angezeigt werden. Soweit kein Problem.
Leider fehlen mir für diesen Tabulator noch die passenden Quick Filter.

Da hier nun die verschiedenen Aktivitäten angezeigt werden, benötige ich ja auch eine Möglichkeit den entsprechenden Filter auf eine bestimmte Aktivität anzuwenden.

Beispiel
Aufgaben:

Code: Select all

(Priority >= 3 OR (ReactionTimeEscalated = 1 OR SolutionTimeEscalated = 1) ) AND T(SPSCommonClassBase).State <> 204
Störungen:

Code: Select all

T(SPSCommonCLassBase).State <> 204 AND (ReactionTimeEscalated = 1 OR SolutionTimeEscalated = 1)
Probleme:

Code: Select all

T(SPSCommonCLassBase).State <> 204 AND (ReactionTimeEscalated = 1 OR SolutionTimeEscalated = 1)
Änderungen:

Code: Select all

T(SPSCommonCLassBase).State <> 10013 AND (ReactionTimeEscalated = 1 OR SolutionTimeEscalated = 1)
Nun dachte ich an so etwas:

Code: Select all

CASE WHEN T(SVCServiceLevelPickupTicketType).Value = 40 THEN (Priority >= 3 OR (ReactionTimeEscalated = 1 OR SolutionTimeEscalated = 1) ) AND T(SPSCommonClassBase).State <> 204
WHEN T(SVCServiceLevelPickupTicketType).Value = 10 OR T(SVCServiceLevelPickupTicketType).Value = 20 THEN T(SPSCommonCLassBase).State <> 204 AND (ReactionTimeEscalated = 1 OR SolutionTimeEscalated = 1)
ELSE T(SPSCommonCLassBase).State <> 10013 AND (ReactionTimeEscalated = 1 OR SolutionTimeEscalated = 1)
END
Values:

Code: Select all

Störungen "10"
Probleme "20"
Änderungen "30"
Aufgaben "40"
Des haut aber net so ganz hin :|

Vielleicht hat hier jemand schon mal so was gemacht. Kann auch sein, dass das so gar nicht in den Quick Filtern geht, da die Query Länge auch ganz schnell erreicht wird.

Mfg
Last edited by andy_m42 on 17. Nov 2017, 15:41, edited 1 time in total.

Sven_Puth
Posts: 461
Joined: 07. Apr 2011, 15:55
Contact:

Re: Quick Filter mit Bedingung

Post by Sven_Puth » 01. Sep 2017, 15:01

Wenn ich deine Query richtig deute willst du mit dem CASE die eigentliche Bedingung ausgeben. Von der Logik her müsstest du aber einfach den Tickettyp in die Bedingung selbst mit einbinden und eine große Bedingung daraus machen. Außerdem werden Pickups eigentlich nicht als Klasse ins CI eingebunden, sondern an ein Attribut innerhalb einer Klasse verbunden, weshalb man sie nicht mit T(<Klasse>) ansprechen kann. Von daher kannst du auch auf UsedInType<TicketType> IS NULL prüfen

Heißt pro Tickettyp setzt du einen großen Block aus logischen-Bedingungen zusammen (Typ AND Auslöser AND Status) und verbindest diese mit einem OR, sodass einer der Bedingungs"blöcke" WAHR sein muss um auszulösen.

Ungefähr so

Code: Select all

(
                (UsedInTypeSPSActivityTypeBase IS NOT NULL)
AND          ((Priority >= 3) OR (ReactionTimeEscalated = 1) OR SolutionTimeEscalated = 1)) 
AND          (T(SPSCommonClassBase).State <> 204)
)
OR
(
               ((UsedInTypeSPSActivityTypeIncident IS NOT NULL) OR (UsedInTypeSPSActivityTypeGroupTicket IS NOT NULL))
AND         ( (ReactionTimeEscalated = 1) OR (SolutionTimeEscalated = 1) )
AND         ( T(SPSCommonCLassBase).State <> 204 )
) 
OR
(
              (UsedInTypeSVMChangeRequestType IS NOT NULL)
AND        ((ReactionTimeEscalated) = 1 OR (SolutionTimeEscalated = 1)) 
AND        (T(SPSCommonCLassBase).State <> 10013)
)
Tria-media - IT Solutions

andy_m42
Posts: 81
Joined: 02. Oct 2014, 14:04
Contact:

Re: Quick Filter mit Bedingung

Post by andy_m42 » 06. Sep 2017, 10:31

Super Hinweis, danke Dir!

Für das erste Beispiel hat es wunderbar funktioniert, allerdings ist mir nun aufgefallen, dass ich die einfache Variante gepostet hatte ;)

Mein Problem ist eher der Filter für Mittel und Niedrig, da hier die angesprochene Query Länge schnell erreicht wird.

Bin mir nicht sicher ob ich dies noch weiter komprimieren kann. Dieser Query ist für das Feld zu lang.

Code: Select all

((UsedInTypeSPSActivityTypeBase IS NOT NULL)
AND (Priority = 2 AND T(SPSCommonClassBase).State <> 204))
OR ((UsedInTypeSPSActivityTypeIncident IS NOT NULL)
AND ((ReactionTimeEscalated = 0 AND SolutionTimeEscalated = 0) AND
((T(SPSCommonCLassBase).State <> 204 AND SolutionPoint IS NOT NULL AND SolutionPoint <= DATEADD(mi,30, GetDate())) OR
(T(SPSCommonCLassBase).State = 200 AND ReactionPoint IS NOT NULL AND ReactionPoint <= DATEADD(mi,15, GetDate()))    
))) OR ((UsedInTypeSPSActivityTypeGroupTicket IS NOT NULL)
AND ((ReactionTimeEscalated = 0 AND SolutionTimeEscalated = 0) AND
((T(SPSCommonCLassBase).State <> 204 AND SolutionPoint IS NOT NULL AND SolutionPoint <= DATEADD(mi,1440, GetDate())) OR
(T(SPSCommonCLassBase).State = 200 AND ReactionPoint IS NOT NULL AND ReactionPoint <= DATEADD(mi,120, GetDate()))    
))) OR ((UsedInTypeSVMChangeRequestType IS NOT NULL)
AND (ReactionTimeEscalated = 0 AND SolutionTimeEscalated = 0) AND
((T(SPSCommonCLassBase).State <> 10013 AND SolutionPoint IS NOT NULL AND SolutionPoint <= DATEADD(mi,2880, GetDate())) OR
(T(SPSCommonCLassBase).State = 10001 AND ReactionPoint IS NOT NULL AND ReactionPoint <= DATEADD(mi,120, GetDate()))))
Bessere Lesbarkeit

Code: Select all

(
                (UsedInTypeSPSActivityTypeBase IS NOT NULL)
AND          (Priority = 2 AND T(SPSCommonClassBase).State <> 204)
)
OR
(
               (UsedInTypeSPSActivityTypeIncident IS NOT NULL)
AND         ( (ReactionTimeEscalated = 0 AND SolutionTimeEscalated = 0) AND
(  
	(T(SPSCommonCLassBase).State <> 204 AND SolutionPoint IS NOT NULL AND SolutionPoint <= DATEADD(mi,30, GetDate()))  OR  
	(T(SPSCommonCLassBase).State = 200 AND ReactionPoint IS NOT NULL AND ReactionPoint <= DATEADD(mi,15, GetDate()))    
)
))
OR
(
               (UsedInTypeSPSActivityTypeGroupTicket IS NOT NULL)
AND         ( (ReactionTimeEscalated = 0 AND SolutionTimeEscalated = 0) AND
(  
	(T(SPSCommonCLassBase).State <> 204 AND SolutionPoint IS NOT NULL AND SolutionPoint <= DATEADD(mi,1440, GetDate()))  OR  
	(T(SPSCommonCLassBase).State = 200 AND ReactionPoint IS NOT NULL AND ReactionPoint <= DATEADD(mi,120, GetDate()))    
)
))
OR
(
              (UsedInTypeSVMChangeRequestType IS NOT NULL)
AND        (ReactionTimeEscalated = 0 AND SolutionTimeEscalated = 0) AND
(
	(T(SPSCommonCLassBase).State <> 10013 AND SolutionPoint IS NOT NULL AND SolutionPoint <= DATEADD(mi,2880, GetDate()))  OR
	(T(SPSCommonCLassBase).State = 10001 AND ReactionPoint IS NOT NULL AND ReactionPoint <= DATEADD(mi,120, GetDate()))
))

Sven_Puth
Posts: 461
Joined: 07. Apr 2011, 15:55
Contact:

Re: Quick Filter mit Bedingung

Post by Sven_Puth » 06. Sep 2017, 13:17

Hmm... ok, tricky. Du könntest aus den unteren OR Blöcken das ReactionTimeEscalated = 0 AND SolutionTimeEscalated = 0 herauskürzen und nur einmal darauf prüfen.
Also alle Blöcke mit dieser Abfrage drin doppelt einklammern und in der letzten Klammer die AND ((ReactionTimeEscalated = 0 AND SolutionTimeEscalated = 0)) Abfrage anhängen. Vielleicht bringts ja was

Code: Select all

(
                (UsedInTypeSPSActivityTypeBase IS NOT NULL)
	AND          (Priority = 2 AND T(SPSCommonClassBase).State <> 204)
)
OR
((
		(
               (UsedInTypeSPSActivityTypeIncident IS NOT NULL)
			AND         
				(										
					(  
					(T(SPSCommonCLassBase).State <> 204 AND SolutionPoint IS NOT NULL AND SolutionPoint <= DATEADD(mi,30, GetDate()))  OR  
					(T(SPSCommonCLassBase).State = 200 AND ReactionPoint IS NOT NULL AND ReactionPoint <= DATEADD(mi,15, GetDate()))    
					)
				)
	)
	OR
	(
               (UsedInTypeSPSActivityTypeGroupTicket IS NOT NULL)		
				AND
				(  
					(T(SPSCommonCLassBase).State <> 204 AND SolutionPoint IS NOT NULL AND SolutionPoint <= DATEADD(mi,1440, GetDate()))  OR  
					(T(SPSCommonCLassBase).State = 200 AND ReactionPoint IS NOT NULL AND ReactionPoint <= DATEADD(mi,120, GetDate()))    
				)			
	)
	OR
	(
              (UsedInTypeSVMChangeRequestType IS NOT NULL)
			AND        
		(
		(T(SPSCommonCLassBase).State <> 10013 AND SolutionPoint IS NOT NULL AND SolutionPoint <= DATEADD(mi,2880, GetDate()))  OR
		(T(SPSCommonCLassBase).State = 10001 AND ReactionPoint IS NOT NULL AND ReactionPoint <= DATEADD(mi,120, GetDate()))
		)
	)
) AND ((ReactionTimeEscalated = 0 AND SolutionTimeEscalated = 0))
)
Tria-media - IT Solutions

andy_m42
Posts: 81
Joined: 02. Oct 2014, 14:04
Contact:

Re: Quick Filter mit Bedingung

Post by andy_m42 » 19. Sep 2017, 10:23

Hi, komme leider erst jetzt wieder dazu mich zu melden.

Dein Query ist bei mir nun 1064 Zeichen lang, erlaubt sind wohl 600.

Vielen Dank für deine Unterstützung.

Sven_Puth
Posts: 461
Joined: 07. Apr 2011, 15:55
Contact:

Re: Quick Filter mit Bedingung

Post by Sven_Puth » 20. Sep 2017, 09:41

Ok, man könnte natürlich auch neue Attribute zur Hilfe nehmen und diese via Konformitätsregel setzen und nur auf eben diese Filtern. also UD_Critical, UD_Medium, UD_Low als Boolean in der gemeinsamen SPSActivityClassBase anlegen und die Bedingungen in entsprechenden CRs anwenden und die Werte setzen.
Tria-media - IT Solutions

andy_m42
Posts: 81
Joined: 02. Oct 2014, 14:04
Contact:

Re: Quick Filter mit Bedingung

Post by andy_m42 » 17. Nov 2017, 15:39

Hört sich gut an, sollte auch so funktionieren.
Mit dieser Idee hat sich es für mich erledigt.

Danke für den Denkanstoß.

Post Reply

Return to “Customizing und Reporting”

Who is online

Users browsing this forum: No registered users and 9 guests