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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Min and Max for Date Feild

Hi,

I want that Insert date field should show max and min date.

If there is two shipments against one order then insert date should pick min date first and then max date second for that particular shipment.

Please find the sample data of shipments, insert date ,order & cost.

Regards,

5 Replies
muthukumar77
Partner - Creator III
Partner - Creator III

Hi,

Load shipment_id, Min(Insert_date), Max(Insert_date)

from table group by shipment_id;

use this script. I hope it will helpful.

Muthukumar Pandiyan
MindaugasBacius
Partner - Specialist III
Partner - Specialist III

If I made the correct data table from your excels than I do not get any Order that have few Shipments. Please correct me if I am wrong.

But the script should look like this:

Original:

LOAD date(Floor(timestamp#(INSERT_DATE, 'DD-MM-YYYY hh:mm')), 'YYYY-MM-DD') as INSERT_DATE

     ,ORDER_ID

     ,COST

     ,SHIPMENT_ID

FROM

(ooxml, embedded labels, table is Sheet1)

;

Grouped:

LOAD ORDER_ID as Order

  ,sum(COST) as Sum_Cost

  ,min(INSERT_DATE) as Min_Date

  ,max(INSERT_DATE) as Max_Date

Resident Original

Group by ORDER_ID

;

Results look like this:

Screenshot_2.png

Not applicable
Author

Hi,

Below Script code does not work it gives error as Invalid expression.

regards,

Not applicable
Author

Hi,

I want that if there is Two shipments against one order then Insert date field should pick two shipments according to Insert date and time.

i.e First In First Out basis.

For Eg :

1. Shipment1 insert date is 02-04-2016 10.10.00

2. Shipment2 insert date is 02 -04-2016 11.10.00

that means Shipment 1 Insert date should pick 10.10.00 first and then shipment2 second.

I hope you got my issue

Regards

Not applicable
Author

Hi,

Please provide some solution on my query.

Kindly suggest i need to do Insert date min and max formula at script level or on chart level.

Regards