Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
lain_
Contributor III
Contributor III

Get Average Between Dimensions

With the tables I have in the qvw file below, one is a table of Var1 and some values calculated from an expression, the other  is a table of Var2 and some values calculated from an expression. How do I take the average of these values, so that Var1 has an associated average and Var2 has an associated average. The goal is to then graph this. I attached an excel file of what I want to avoid confusion.

1 Solution

Accepted Solutions
Taoufiq_Zarra

Maye be qvw attached file ?

Capture.PNG

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

4 Replies
Taoufiq_Zarra

Maye be qvw attached file ?

Capture.PNG

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
lain_
Contributor III
Contributor III
Author

Thank you so much. To expand on this. How would I go about adding a listbox to select the Var1, Var2. Let's say I have Var1, Var2, Var3, Var4 and I want to be able to select some of these to do the calculations.

Taoufiq_Zarra

@lain_ 

in this case I suggest you change ValueList to island table:

attached qvw file

 

 

 

IslanTable:

LOAD * INLINE [

Var,Measure

Var1,Avg(total aggr(sum(total <Var1> value1) / sum(total <Var1> value2),Var1))

Var2,Avg(total aggr(sum(total <Var2> value1) / sum(total <Var2> value2) ,Var2))

];

 

 

 

 

Capture.PNG

 

Capture.PNG

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
lain_
Contributor III
Contributor III
Author

Thank you! I ended up needing to use a variable so I couldn't implement what you did with the load script, so I expanded on your first solution by replacing the value list with the listbox and adding more Var(s) in the match function. I'll accept your first solution to this since it directly solves my original question in case anyone else needs it.