Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Filtering out data

Dear all

I am working with the following data and is required to list the genres of movies that Lawyers liked the most (based on Rating).

I need to create a bar chart to list the Title and the Total Rating (only ratings by Lawyers and exclude all other occupation).

What codes do I place in my expression to calculate the total ratings of lawyers only?

Thank you!

     

MovieIDTitleRatingGenresUserIDGenderOccupation
1Toy Story (1995)5Animation719MLawyer
2Jumanji (1995)4Adventure1056MStudent
3Grumpier Old Men (1995)4Comedy1187FLawyer
4Waiting to Exhale (1995)5Comedy1200MLawyer
5Father of the Bride Part II (1995)5Comedy1296MLawyer
6Heat (1995)4Action1458MTeacher
7Sabrina (1995)5Comedy1509MLawyer
8Tom and Huck (1995)3Children's1573MStudent
9Sudden Death (1995)4Action1919MLawyer
10GoldenEye (1995)3Action1926FLawyer
11American PresidentThe (1995)3Drama2045FTeacher
12Dracula: Dead and Loving It (1995)5Horror2120MStudent
13Balto (1995)5Children's2169MStudent
14Nixon (1995)5Drama3234FLawyer
15Cutthroat Island (1995)5Action3594MLawyer
16Casino (1995)4Thriller3780MLawyer
17Sense and Sensibility (1995)4Drama4633MLawyer
18Four Rooms (1995)5Thriller4707MTeacher
19Ace Ventura: When Nature Calls (1995)5Comedy5074MLawyer
13 Replies
sunny_talwar

Sure, use Sum... I guess the point Felip was trying to get across was the fact that to get Sum or Avg of just one type of Occupation, you need to use set analysis like this

{<OccGroup={"Lawyer"}>}

But ya, if Sum is what you need, then Sum it is

Not applicable
Author

I'm a total doofus with this.

Good news is the chart works!

Thank you Felip and Sunny

Not applicable
Author

Hi Sunny

If you have the time, could you please help with this question.

Listing top 10 and comparison by gender

Thank you!

Not applicable
Author

hi Jess, how u want do the visualization of the bar chart, like this: in the top are the bar char for all the ocupations and the botton just fot lawyers, with this expression in the measure. sum({<Occupation={"Lawyer"}>}Rating)  in order to have raiting avg the express would be avg ({<Occupation={"Lawyer"}>}Rating)

bar char.JPG

i hope i cant help u, let me know about it.