Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

cancel
Showing results for 
Search instead for 
Did you mean: 
Jojo17
Contributor
Contributor

Subfield for Movie Genres

Hi there, 

my data looks as follows:

Genres:
Animation | Children | Comedy 
Fantasy 
Action | Adventure | Romance 
Drama | Thriller 


(and the list goes on, with each movie having various numbers of genres) 

Am looking to use the sub field function to do an assessment on the Genres, would need some help here, thank you! 🙂 

 

2 Solutions

Accepted Solutions
uacg0009
Partner
Partner

Hi Jodi,
I assume that you have "movie" and "genre" in your table.
And firstly you need to use subfield() in your srcipt,like:
load movie,
subfield(genre,'|') as genre
resident yourtable;
Then in the front-end, you can create a straight table:
dimension: genre
expression: count(distinct movie)
please try.
Aiolos Zhao

View solution in original post

Anil_Babu_Samineni

Error - Because, You are using same field with in the Single Load. Perhaps this?

LOAD MovieID,
            Title,
            Subfield(Genres, '|') as Genres

From Sample;

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

View solution in original post

7 Replies
Anil_Babu_Samineni

What you want from that data? May be

Subfield(FieldName, '|') as Output

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Jojo17
Contributor
Contributor
Author

One movie is tagged to a few genres and I would like to have a chart which shows the various genres and the number of movies per genre. 

Anil_Babu_Samineni

Your data structure not understand to me. Can you create proper data and expected result 

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
uacg0009
Partner
Partner

Hi Jodi,
I assume that you have "movie" and "genre" in your table.
And firstly you need to use subfield() in your srcipt,like:
load movie,
subfield(genre,'|') as genre
resident yourtable;
Then in the front-end, you can create a straight table:
dimension: genre
expression: count(distinct movie)
please try.
Aiolos Zhao
Jojo17
Contributor
Contributor
Author

My data file looks as follows:

movie.PNG

I would like to create a chart which shows which genre is most popular. 

I tried the following: 

LOAD MovieID,
            Title,
            Genres

           Subfield(Genres, '|') as Genres

But it did not return a result and was an error. 

Anil_Babu_Samineni

Error - Because, You are using same field with in the Single Load. Perhaps this?

LOAD MovieID,
            Title,
            Subfield(Genres, '|') as Genres

From Sample;

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Jojo17
Contributor
Contributor
Author

I see, thanks! Managed to get it to work now 🙂