Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Petrolucio
Contributor II
Contributor II

Average expression shows values not average

Hello i am new to qlikview.

In SQL all these ideas i have work but here they dont.

I have 2 tables as in picture attached.

I used this as join:

 

Student:
LOAD BI,
Ime,
Prezime,
Adresa,
Grad,
Pol
FROM
[Zadatak dva.xlsx]
(ooxml, embedded labels, table is Studenti);

left join(Student)

Ispit:
LOAD BI,
PredmetID,
Ocena,
[Godina studija]
FROM
[Zadatak dva.xlsx]
(ooxml, embedded labels, table is [Ispiti 4 godina]);

 

 

And as you can see in problem.png attachemnt when i dont enter "Ocena=Score(on english)" the avg count actually works and show unique ID,Name,LastName but as soon as i enter Ocena where i expect to show average from all Marks.

Tried a lot of things but it always fails.

1 Solution

Accepted Solutions
Or
MVP
MVP

Sorry, but I still don't follow. Why are you using a table box rather than a straight table? Why are you adding Ocena as a dimension instead of just using an Avg(Ocena) measure?

View solution in original post

6 Replies
Or
MVP
MVP

It's a bit hard to figure out what you're doing, but if I understand it correctly, you expect the Ocena column in your second table to show the average Ocena for the first three dimensions? It looks like it's been added as a dimension, whereas if you want it to be averaged, you need to add it as a measure and use avg(Ocena).

Not sure if that's what you meant or not....

Petrolucio
Contributor II
Contributor II
Author

Hmm, let me try to explain better. IF you look at problem 2.png, you will see 2 tables in excel.

I want to create a table box in qlickview, that will show "BI,Ime,Prezime" from "table1" and "Ocena" as average measure from "table 2".

Connection between 2 tables is "BI"

If i put BI,Ime,Prezime in table box as fields displayed and sort "BI" as expression AVG(Ocena) it will show the table that you see on problem.png as left table.

 

But as soon as i also add "Ocena" as field displayed even if there is AVG(Ocena) as expression on "BI" it will show as table on the right in problem.png

 

Hopefully i was able to explain better now.

Or
MVP
MVP

Sorry, but I still don't follow. Why are you using a table box rather than a straight table? Why are you adding Ocena as a dimension instead of just using an Avg(Ocena) measure?

Petrolucio
Contributor II
Contributor II
Author

Thanks a lot man i am new to qlickview, sorry and i broke my head so long when the answer was simple... I created all tables as table box instead of straight table oh god im so stupid and i tried all possible joins and i still couldn't do what i wanted ahahahaha

And now i tried with straight table and it works 

Thanks a lot

Or
MVP
MVP

Great! Rule of thumb is to never use Table Box unless you have a really good reason. Straight table is (almost?) always the better option.  Glad you got it working.

Petrolucio
Contributor II
Contributor II
Author

Thanks again for the help, you saved me. Have a great day!