Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How I get the Numbers with x ?

Hello,

my next problem, I have two columns external and amount days. I need only the days with x in the same row.

ExternalAmount of days
x2
5
x4
x3
9

After that I need to calculate the Average days of the external.

Could you help me, to give me the spirit to the solution.

Thanks.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

If you need the average of the days where External has the value 'x' try this expression in a text box:

=avg({<External={'x'}>} [Amount of Days])


talk is cheap, supply exceeds demand

View solution in original post

7 Replies
adamwilson
Partner - Creator
Partner - Creator

Hi,

To calculate the average days of External, create a chart, use External as your dimensions and Avg([Amount of days]) as you expresion.

This will result in one row for each distinct value in External with the average of Amount of days.

Adam

Gysbert_Wassenaar

If you need the average of the days where External has the value 'x' try this expression in a text box:

=avg({<External={'x'}>} [Amount of Days])


talk is cheap, supply exceeds demand
Not applicable
Author

Thank you it works.

But can you me explain, why do you need the {<{}>} formulas?

khadeer
Specialist
Specialist

That function is written in set analysis, that is necessary for set analysis.

Not applicable
Author

How can I get the formular in a YTD Formular:

This here is my try, but it doesn't work:

avg({<Year={$(vMaxYear)},Date={'<=$(vMaxDate)'},Month=>}avg({<[FAK Kennzeichen]={'X'}>} [Anz Tage])

Could you help me.

Thanks.

Gysbert_Wassenaar

Try: avg({<Year={$(vMaxYear)},Date={'<=$(vMaxDate)'},Month=,[FAK Kennzeichen]={'X'}>} [Anz Tage])

This all assumes you have fields called Year, Month and Date and a variable called vMaxDate that contains a valid date value.


talk is cheap, supply exceeds demand
Not applicable
Author

Thank you, it is the right answer.