Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Mahathi
Contributor
Contributor

combing and Using different dates in the same report

Good Morning, I have a Qlik sense requirement - building 2 table reports using the following columns from raw data as below. order date, order_id, channel, returned _date, qty_ordered, qty_returned.  All from same sales table.

I also have a date column from master calendar.

order dateorder_idchannelreturned dateqty_orderedqty_returned
8/3/202028948direct8/28/20201412
8/3/202092934paid8/27/20202120
8/4/202092936display9/11/20202222
8/27/202099526display10/1/20201313
9/5/202095007social10/15/20202121
9/5/202095070social10/15/20202121
9/26/202067176paid10/28/20201919
10/7/202075627direct11/3/20202626
10/7/202075843paid11/20/20201111
10/29/202099143display11/24/20203130
11/3/202091641shopping11/25/20202322
11/4/202099252paid11/30/20202727
11/5/202094192social11/30/20202020
11/30/202027333direct1/12/20211717
11/30/202032145paid1/14/20211313

Report 1:

I need to build a report with sum(qty_ordered) and sum(qty_returned) as measures and date as dimension. Sum(qty_ordered) should be rolled up to order date, however I need to show the Sum(qty_returned) rolled up at the returned date instead of the order date as shown in the example below.

Since the order date in sales table is associated with the date in the master calendar, I don’t have an issue with qty_ordered but to show the qty_returned at the returned date I need suggestions.  

In the example below for order date 8/27/2020 Sum(qty_ordered) is 13 but for returned date 8/27/2020 qty_returned is 21. These 2 quantities need to be displayed in the same line with the same date even though they do not belong to the same transaction.

dateSum(qty_ordered)Sum(qty_returned) 
8/3/2020350
8/4/2020220
8/27/20201320
8/28/2020012
9/5/2020420
9/11/2020022
9/26/2020190
10/7/2020370
10/15/2020042
10/28/2020019

 

Report 2:

In the same way for second report as well, the qty_returned should be shown at the returned date instead of order date. The qty_ordered should still be at the order date. But here I am using another dimension channel.

Here as well for order date 8/27/2020 Sum(qty_ordered) is 13 for channel ‘display’ but for returned date 8/27/2020 qty_returned is 21 for channel ‘paid’, but both need to be displayed under the same date 8/27/2020 even though they are not same channel, hence why we have 2 lines one for each channel. I want to be able to implement this logic for multiple other dimensions not just channel in different reports.

datechannelSum(qty_ordered)Sum(qty_returned) 
8/3/2020direct140
8/3/2020paid210
8/4/2020display220
8/27/2020display130
8/27/2020paid020
8/28/2020direct012
Labels (2)
1 Reply
Vegar
MVP
MVP

Consider remodelling your master calendar handling so that all fields are associated to the master calendar. It could make your reports easier to handle.

Take look at the Tutorial using common date dimensions by Rob Wunderlich and the Canonical Date by HIC