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: 
eadbhard
Contributor III
Contributor III

Counting two expressions by the same dimension

Hi there,

I have a fact table with shipment number, shipment arrival week and shipment departure week columns. Fact table is linked to a master calendar table that has a calendar week column:Picture1.png

I need a bar chart where the dimension would a week, and the expressions would be two bars, one showing how many shipments arrived in the week and another bar showing how many shipments departed in the same week. Something like this :

Picture2.png

Now, I think the dimension of the chart would be the calendar week from the calendar table, but I can't figure out the suitable "Count(shipment_number)" expressions.

Any help is greatly appreciated, thank you!

 

 

 

1 Solution

Accepted Solutions
dplr-rn
Partner - Master III
Partner - Master III

3 Replies
dplr-rn
Partner - Master III
Partner - Master III

eadbhard
Contributor III
Contributor III
Author

Thank you, you got that right! I made an additional, 'canonical date' based table, where each record has only three columns: the shipment number, a date (the canonical date), and the "Event" column, which could be either 'Received' or 'Shipped'. Then the expressions were relatively easy to figure out: 

=Count({<Event={'Received'}>} Shipment_Number)
=Count({<Event={'Shipped'}>} Shipment_Number)

The dimension was the canonical date on the master calendar, which is linked to the canonical date of the additional table I created.

Thanks a lot!

-Eduardo

dplr-rn
Partner - Master III
Partner - Master III

my pleasure