Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Qlik Community,
I would like some help with grouping four values from one dimension into two groups so that I can perform some analysis on them.
I have a field named 'fielfOfStudy' and it contains 4 different values, 'Science', 'Physics', 'English' and 'Social studies'.
I would like to create two groups, one that contain Science and Physics and one that contains the other two.
I've been messing around with the Aggr function but I can't quite find a solution.
To give some context. I'm building a bar chart that shows the % split between the two groups that I'm trying to build. I have the code down on that 100 % bar chart but I don't know how to group the values.
Any help is appreciated
Casper
Hi
try with this expression
=Aggr(If(Match(fielfOfStudy,'Science','Physics')>0,'Group 1','Group 2'),fielfOfStudy)
Hi! Just paste the expression provided by StarinieriG as a calculated dimension (not as expression).
Regards,
Jaime.
Hi
try with this expression
=Aggr(If(Match(fielfOfStudy,'Science','Physics')>0,'Group 1','Group 2'),fielfOfStudy)
Thanks for your reply.
The solution looks promising but I don't know how to implement it.
This is what I had beforehand. This creates a bar chart where each field's percentage split is show out of a hundred. Can you give me a hint as how to implement your solution in my expression so that I can perform it by the group basis?
= sum ( {<
fieldOfStudy = {[Science] , [Physics] , [Englsh] , [Social studies] } >} [studyData])
/
sum ( Total <Year>
{<
fieldOfStudy = {[Science] , [Physics] , [Englsh] , [Social studies] } >} [studyData])
Any help is appreciated
Casper
Hi! Just paste the expression provided by StarinieriG as a calculated dimension (not as expression).
Regards,
Jaime.
That did the trick.
I appreciate that.