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: 
Not applicable

set analysis in bar graph(urgent)

hey guys, i have a stacked bar graph, the dimensions are

1. Name of the owner

2. subject of the book

The order is same while defining the dimensions.

Now, i have to calculate the % share of every subject book by each owner. Ex: owner 1 has 20% of his books from history subject and 80% from Geography.

the formula, i am using is:

 

=

sum

(No. of Books)/sum({$<Subject= {History}, Subject= {Geography}>}Geo_Active_Ptns)

But i am getting history as 100% and geography too 100%, what is the mistake in my expression and what should be the correct expression?

9 Replies
Not applicable
Author

TRY

=

sum(No. of Books)/sum( TOTAL Geo_Active_Ptns)

Not applicable
Author

Thanks felim for the reply.

if i have a coloumn name for school also, and i have to calculate the expression for that school only. this expression will give me the % composition of each subject book wrt the total no. of books in all the school. wha t if we have to calculate it wrt a particular school.

EX: we have 38% of history books of all the books in school 'A'.

I hope you understand the problem.

Not applicable
Author

try

Sum({$} [No. of Books]) / Sum ( {$<Subject = {'History','Geography'}>} Geo_Active_Ptns)

Not applicable
Author

Hey felim, thanks for the reply but this is the same thing, i was doing before and getting the problem.

Not applicable
Author

Sorry confusing thread - for clarification you want Sum of Books / Sum of All Books

=sum(No. of Books)/sum( TOTAL Geo_Active_Ptns)

That will give you the data you need, if you add a school dimension do you want to put the school in your set analysis im getting confused. can you attach a file?

Not applicable
Author

my data coloumns are:

School      student name     Subject     no. of books

i want to calculate, what % is of history book wrt to his total books a particular student has in a particular school.

what should be the expression?

Not applicable
Author

got ya

Not applicable
Author

Sum(no_of_books) / Sum(Total <School> no_of_books)

Set the number type to show in %

Not applicable
Author

Example here