Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
rexhina
Contributor II
Contributor II

average of 2 columns subtraction

I have a table in Qlik sense and I want to find the average of the difference between two columns. The table is like this :

I want to write a function to find the average of the difference between two columns. I have tried something like this : 

avg(aggr(if(not is null (day 1) and not is null(day2),day2-day1)),customer  name ) 

but it is not working.  Help me with this

Day 1  Day 2 Average of difference between the day2 and day1 
24.11.2021 27.11.2021  
12.12.2021    
13.12.2021 18.12.2021  
  17.1.2022  
3.1.2022 7.1.220  
Labels (8)
1 Solution

Accepted Solutions
rexhina
Contributor II
Contributor II
Author

i have found the solution myself it will be the formula like this :

avg(aggr(if(not is null (day 1) and not is null(day2),(day2-day1))),day2,day1 ) 

 

View solution in original post

1 Reply
rexhina
Contributor II
Contributor II
Author

i have found the solution myself it will be the formula like this :

avg(aggr(if(not is null (day 1) and not is null(day2),(day2-day1))),day2,day1 )