Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set Analysis "Count"

Hello,

we have the following table with the 24 hours that in our model is an island:

Timeline:

LOAD * INLINE [ Hour, Hour_Min, Hour_Range

0, 00:00, 00:00-01:00

1, 01:00, 01:00-02:00

2, 02:00, 02:00-03:00

3, 03:00, 03:00-04:00

4, 04:00, 04:00-05:00

5, 05:00, 05:00-06:00

6, 06:00, 06:00-07:00

7, 07:00, 07:00-08:00

8, 08:00, 08:00-09:00

9, 09:00, 09:00-10:00

10, 10:00, 10:00-11:00

11, 11:00, 11:00-12:00

12, 12:00, 12:00-13:00

13, 13:00, 13:00-14:00

14, 14:00, 14:00-15:00

15, 15:00, 15:00-16:00

16, 16:00, 16:00-17:00

17, 17:00, 17:00-18:00

18, 18:00, 18:00-19:00

19, 19:00, 19:00-20:00

20, 20:00,20:00-21:00

21, 21:00, 21:00-22:00

22, 22:00, 22:00-23:00

23, 23:00, 23:00-00:00 ];

And this other table with some data related to another timeline table:

Fecha registro - Hora registro

2011-01-01        11

2011-01-01        08

2011-01-02        23

2011-01-03        16

Now we need a bar chart that counts in every single hour how many "Registros" have been done.

The expression we're usign:

Count({$<[Hora registro] = p(Hour)>}[Hora registro])

I guess that we're counting hours vs hours... not "registros" vs hours.

Any suggestion? We're kind of stucked in this.

Thanks

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Hi,

I think you can't use your dimension in the set expression like this.

But try this:

Create a chart with dimension Hour_Min and as expression:

=count(if(Hour=[Hora registro],[Hora registro]))

On presentation tab, you may want to deactivate suppress zero values to get a full range of Hour_Min.

Hope this helps,

Stefan

View solution in original post

1 Reply
swuehl
MVP
MVP

Hi,

I think you can't use your dimension in the set expression like this.

But try this:

Create a chart with dimension Hour_Min and as expression:

=count(if(Hour=[Hora registro],[Hora registro]))

On presentation tab, you may want to deactivate suppress zero values to get a full range of Hour_Min.

Hope this helps,

Stefan