Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
qliksus
Specialist II
Specialist II

Date Island Issue

Hi All,

I have set of data on which i want to see the sales by Month , for the first 6 months would be Sum of Sales and rest of 6 months output would be sum of last 3 months.

Input Data:

Date Sale
31/01/2016100
29/02/2016110
31/03/2016120
30/04/2016130
31/05/2016140
30/06/2016150
31/07/2016160
31/08/2016170
30/09/2016180
31/10/2016190
30/11/2016200
31/12/2016210

OutPut:

Report_Date Output
31/01/2016100
29/02/2016110
31/03/2016120
30/04/2016130
31/05/2016140
30/06/2016150
31/07/2016420
31/08/2016450
30/09/2016480
31/10/2016510
30/11/2016540
31/12/2016570

I have tried using Date Island but no luck. Can anyone help me resolve it?

7 Replies
sunny_talwar

May be this:

If(RowNo() <= 6, Sum(Sale), RangeSum(Above(Sum(Sale), 1, 3)))


Capture.PNG

qliksus
Specialist II
Specialist II
Author

Many Thanks Sunny, Range sum won't work here as the base line data is stored in little bit different way. I want to achieve the same using Date Island in Set analysis. let me show you the underline data as

Date Category Sale
31/01/2016A100
31/01/2016B310
29/02/2016A110
29/02/2016B320
31/03/2016A120
31/03/2016B330
30/04/2016A130
30/04/2016B340
31/05/2016A140
31/05/2016B350
30/06/2016A150
30/06/2016B370
31/07/2016A160
31/08/2016A170
30/09/2016A180
31/10/2016A190
30/11/2016A200
31/12/2016A210

We have 2 categories data as A & B, whereas A have all 12 month data and B have only 6 Month data. Basically we need to populate B's 6 month of data based on A's last  6 Month data. Hope it make more clear now

sunny_talwar

What is the expected output here?

qliksus
Specialist II
Specialist II
Author

Hi Sunny,

Expected output is

DateCategorySale
31/01/2016A100
31/01/2016B310
29/02/2016A110
29/02/2016B320
31/03/2016A120
31/03/2016B330
30/04/2016A130
30/04/2016B340
31/05/2016A140
31/05/2016B350
30/06/2016A150
30/06/2016B370
31/07/2016A160
31/08/2016A170
30/09/2016A180
31/10/2016A190
30/11/2016A200
31/12/2016A210
31/07/2016
B420
31/08/2016B450
30/09/2016B480
31/10/2016B510
30/11/2016B540
31/12/2016B570
sunny_talwar

Are there only 2 categories? what happens when there is a third category? 2 of them have values and 1 don't or 1 of them have values and 2 don't. I am confused how this is expanded in your actual dashboard.

qliksus
Specialist II
Specialist II
Author

Hi,

Always there have to be only 2 categories, A should have 12 Month data and B have partial. B's missing month value should be derived based on A's value [ Sum of last 3 Month].

e:g: In case of July-2016, B's value would be sum of A's [Jun-2016 , May-2016, Apr-2016].

Hope you are clear now.

sunny_talwar

Try this:

=Aggr(If(Sum(Sale) = 0, RangeSum(Above(Aggr(Alt(Above(Sum(Sale)), Below(Sum(Sale))), Date, Category), 1, 3)), Sum(Sale)), Category, Date)