Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
the_searge
New Contributor

Avg () on count if conditions

Hello community,

I'm trying to get average values for defined conditions. I created a workaround looking like this:

 

Round
	(Count(
	if(AG_Aufgabentyp = 'Carrier Einkauf: Vorleistung Carrier kündigen' and AG_Fktn_Pool = 'Demontage',Aufgaben_ID) or
	if(AG_Aufgabentyp = 'Carrier Einkauf: Carrier Umsetzung bestätigen' and AG_Fktn_Pool = 'Produktion_Änderung',Aufgaben_ID) or
	if(AG_Aufgabentyp = 'Carrier Einkauf: Carrier und Vorleistungskosten ermitteln' and AG_Fktn_Pool = 'Anfrage',Aufgaben_ID))

/

(Max(Num(Month(AG_Ende)))),0.01)

 

This works fine looking completely on all months of the current year. But I need to get more flexible. I'd like to get correct results by selecting any months in filter. I believe I need to combine Avg() with count if somehow. Shouldn't be to difficult, but I never worked with avg() before. Any help?

 

Labels (2)
1 Reply
sasiparupudi1
Honored Contributor III

Re: Avg () on count if conditions

In a straight table,

Dimension :Month(AG_Ende)

 

expression:

Avg(
{<
AG_Aufgabentyp ={'Carrier Einkauf: Vorleistung Carrier kündigen','Carrier Einkauf: Carrier Umsetzung bestätigen','Carrier Einkauf: Carrier und Vorleistungskosten ermitteln'},
AG_Fktn_Pool={'Demontage','Produktion_Änderung','Anfrage')
>}
Aufgaben_ID)