Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
salto
Specialist II
Specialist II

Orderbook evolution Chart

Hello Community,

     Once again I seek for your invaluable help.

     I have a table like this:

    

DateOrderDateShipmentDateAmount
01/09/201601/09/201603/09/2016

27

01/09/201601/09/201605/09/201670
02/09/201602/09/201606/09/201685
02/09/201602/09/201604/09/201663
03/09/201603/09/201606/09/201631
04/09/201604/09/201607/09/201620

    

My request is to create a chart that shows the evolution of the orderbook: the SUM of Amount ordered and Not Shipped in a per-day basis.

The result (Orderbook) should show something like this:

DateOrderbook
01/09/201697 (+27+70)
02/09/2016245 (+148)
03/09/2016249 (+31-27)
04/09/2016208 (+22-63)
05/09/2016

138 (-70)

06/09/201622 (-85-31)
07/09/20162 (-20)

The expression I have tried is similar to :

=sum ({< Date = {"<=$(=date(ShipmentDate),'DD/MM/YYYY') >= $(=date(OrderDate),'DD/MM/YYYY')"} >} OrderAmount)

But as the Date field has always the same value as the OrderDate, the calculation is not correct. Is the data model ready for this calculation? Would the solution be to create new field with all dates?

Many thanks in advance!

1 Solution

Accepted Solutions
antoniotiman
Master III
Master III

Hi,

maybe

Table:
LOAD Date,
OrderDate,
// ShipmentDate,
   Amount
FROM
[https://community.qlik.com/thread/233236]
(html, codepage is 1252, embedded labels, table is @1);

Table1:
LOAD ShipmentDate as Date,
Amount as Amount1
FROM
[https://community.qlik.com/thread/233236]
(html, codepage is 1252, embedded labels, table is
@1);

and expression

RangeSum(Above(Sum(Amount)-Sum(Amount1),0,RowNo()))

Regards,

Antonio

View solution in original post

10 Replies
marcus_sommer

Maybe something like this (a bit simplyfied):

=sum ({< Date = {"=Date<=ShipmentDate"} >} OrderAmount)

- Marcus

MK_QSL
MVP
MVP

something like this?

salto
Specialist II
Specialist II
Author

Many thanks Manish, it is helpful but I see two disadvantages: first, the data model is changed (and the table sown is just a part of it and cannot make it as you suggest, unfortunately). Second,if I select a single date the calculation results are affected.

Thanks ofr your help!

salto
Specialist II
Specialist II
Author

Thanks Marcus but it does not give the desired results... Can the problem come from the fact that only orders posted that Date are taken in to account for the calculation?

Kind regards

marcus_sommer

Maybe there is a TOTAL missing within the expression and/or that an interrecord-function like above might useful. If this didn't help please provide a small example with a few inline-data and how should the output look like.

- Marcus

Anil_Babu_Samineni

Hey, You input looking Amount. but, in your expression you have taken OrderAmount.

Can you explain more what does indicated the OrderAmount

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
MK_QSL
MVP
MVP

Use this !

Without changing the data model. I have used island table.

antoniotiman
Master III
Master III

Hi,

maybe

Table:
LOAD Date,
OrderDate,
// ShipmentDate,
   Amount
FROM
[https://community.qlik.com/thread/233236]
(html, codepage is 1252, embedded labels, table is @1);

Table1:
LOAD ShipmentDate as Date,
Amount as Amount1
FROM
[https://community.qlik.com/thread/233236]
(html, codepage is 1252, embedded labels, table is
@1);

and expression

RangeSum(Above(Sum(Amount)-Sum(Amount1),0,RowNo()))

Regards,

Antonio

vinieme12
Champion III
Champion III

Do you need this is script or straight table?

Cheers

V

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