Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
newqlikie
Creator
Creator

"Sum of orders" by different dates

Hi everybody,

I have following problem.

I need to display all last send orders of the day, a customer orderd the last time.

Example No. 1:

Customer 1 ordered 7 products on Jun, 27

Customer 2 ordered 3 products on Jun, 23

Customer 3 ordered 12 products on Jun, 21

Customer 4 ordered 5 products on Jun, 28

I tried following function in a qlikview table:

Dimension is:

- Customer

- CustomerCity

Formula is:

=count({$<ORDERINCOMEDATE={"$(=max(ORDERINCOMEDATE))"}>}distinct(TIMESTAMP))

This will display only the orders of the last ORDERINCOMEDATE.

Example No. 2 (we have June 28th):

Customer 1 ordered 0 products on Jun, 27

Customer 2 ordered 0 products on Jun, 23

Customer 3 ordered 0 products on Jun, 21

Customer 4 ordered 5 products on Jun, 28

But I need the list like "Example No. 1".

What do I do wrong?

Here is my script:

Orderdetails:

load *, CUSTOMERNO1 & '.' & CUSTOMERNO2 as TNNR,

SQL SELECT

    CUSTOMERNO1,

    CUSTOMERNO2,

    ORDERINCOMEDATE,

    ORDERINCOMETIME,

    timestamp(ORDERINCOMEDATE, ORDERINCOMETIME) as TIMESTAMP

FROM erp\database;

Customercontacts:

LOAD

     TNNR,

     Customer,

     CustomerCity

FROM

\\serverfile\excel

Thanks for your help

Regards

        NewQlikie

1 Reply
swuehl
MVP
MVP

Set analysis will be evaluated once per chart, not per customer line. Try with FirstSortedValue:

=FirstSortedValue(

     aggr( count(DISTINCT TIMESTAMP), ORDERINCOMEDATE),

     aggr( -ORDERINCOMEDATE, ORDERINCOMEDATE)

)