Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Create a bar chart group by column

WorkerPeriodABCD
12016011100
22016011010
32016010000
42016010011
12016021110
22016021100
32016031110
42016040000

The table above is a simplified sample of the database that i'm using.

I would like to create a bar chart that shows the sum of workers who are using, A, B, C and D.


Could someone tell me the best way to handle this problem?

1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

Script:

CrossTable(USING,Value,2)

LOAD * INLINE [

Worker,Period,A,B,C,D

1,201601,1,1,0,0

2,201601,1,0,1,0

3,201601,0,0,0,0

4,201601,0,0,1,1

1,201602,1,1,1,0

2,201602,1,1,0,0

3,201603,1,1,1,0

4,201604,0,0,0,0

];

Grouped chart:

Dimensions: Period, USING

Expression Sum(Value)

241981.1.PNG

Stacked Chart

241981.2.PNG

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

5 Replies
shraddha_g
Partner - Master III
Partner - Master III

Workers using A:

Count({<A = {'1'}>}Worker)

Similarly for others

Not applicable
Author

I would like to create a Bar chart with as dimension A, B, D and count(Worker) as measure.

vinieme12
Champion III
Champion III

Script:

CrossTable(USING,Value,2)

LOAD * INLINE [

Worker,Period,A,B,C,D

1,201601,1,1,0,0

2,201601,1,0,1,0

3,201601,0,0,0,0

4,201601,0,0,1,1

1,201602,1,1,1,0

2,201602,1,1,0,0

3,201603,1,1,1,0

4,201604,0,0,0,0

];

Grouped chart:

Dimensions: Period, USING

Expression Sum(Value)

241981.1.PNG

Stacked Chart

241981.2.PNG

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
vinieme12
Champion III
Champion III

Try with

Dimension as

USING

and

Expression as

Count(Worker)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
shraddha_g
Partner - Master III
Partner - Master III

Try:

Dimension : Valuelist('A','B','C')

Measure:

Pick(wildmatch(Valuelist('A','B','C'),'A','B','C'),

Count({<A = {'1'}>}Worker),

Count({<B = {'1'}>}Worker),

Count({<C = {'1'}>}Worker)

)