Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
maarcus_smith
Contributor II
Contributor II

Set analysis for a bar chart

hi experts,

i have a formula that i need to include another set analysis expression in it for 2 types of roles.

this is the current expression:

sum({<Flag={"1"}>} [Total Hours])
/
sum({<[Type]=,Flag={"1"}>} total <Week,Year> [SumOfSch Hrs])

 

i want to update the expression for both sums so that it only takes in values from a field named "Stream" and a value within that field named "new".

i will then put in the same expression again but this time look for a value named "old" in the field "Stream" .

my aim here is to have 2 separate bar charts in for each of my x axis months.

is this possible? 

thanks 

 

 

Labels (1)
5 Replies
Or
MVP
MVP

I'm not sure what you mean by "my aim here is to have 2 separate bar charts in for each of my x axis months.", but there should be no problem adding an extra set analysis into your existing formulas (just add , Stream = {"new"} at the end of the set analysis and likewise for old) and creating one formula each for new and old.

maarcus_smith
Contributor II
Contributor II
Author

hi @Or  

sorry i should have said that when i put it in the expression editor, it says expression ok but no data is coming up.

i know data is there as when i would select a value in the "stream" field, it changes the chart.

my expression =

sum({<Flag={"1"} ,[Stream]={'Old'}>} [Total Hours])
/
sum({<[Type]=,Flag={"1"}, [Type]={'Old'}>} total <Week,Year> [SumOfSch Hrs])

any idea where im going wrong?

maarcus_smith
Contributor II
Contributor II
Author

hi 

sorry i should have said that when i put it in the expression editor, it says expression ok but no data is coming up.

i know data is there as when i would select a value in the "stream" field, it changes the chart.

my expression =

sum({<Flag={"1"} ,[Stream]={'Old'}>} [Total Hours])
/
sum({<[Type]=,Flag={"1"}, [Type]={'Old'}>} total <Week,Year> [SumOfSch Hrs])

any idea where im going wrong?

maarcus_smith
Contributor II
Contributor II
Author

hi @Or  

sorry i should have said that when i put it in the expression editor, it says expression ok but no data is coming up.

i know data is there as when i would select a value in the "stream" field, it changes the chart.

my expression =

sum({<Flag={"1"} ,[Stream]={'Old'}>} [Total Hours])
/
sum({<[Type]=,Flag={"1"}, [Type]={'Old'}>} total <Week,Year> [SumOfSch Hrs])

any idea where im going wrong?B

Or
MVP
MVP

Check each part of the formula individually. At the very least, having Type = and Type = {Old} is redundant in the bottom sum. Shouldn't it be Stream = Old rather than Type = Old?