I have some movie information in a database, simplified it looks like this:
table movie
-----------
id title
1234 batman
4456 spiderman
table movie_info
-----------------
id movie_id info_type_id info
1 1234 1 USA
2 1234 1 Canada
3 1234 2 Action
3 1234 2 Drama
4 4456 1 France
table info_type
---------------
id info_type
1 country
2 genre
What I'm trying to do is creating a map displaying where the movies are created and then trying to filter them by genre. The mapping part works but when I filter by genre it only shows all movies when I set genre to Null as filter..
I tried a lot of stuff already with calculated fields and joining the data source with custom SQL to itself on movie_id but nothing seems to be working. I would appreciate if anyone could point me in the right direction to tackle this problem.
Calculated fields: Production Country:
IF[info_type_id]=8
THEN [info]
END
Genre:
IF[info_type_id]=3
THEN [info]
END
Custom SQL (for genres):
SELECT movie_id, info AS genre
FROM movie_info
WHERE info_type_id=3