Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all, I need help with how to write a script.
I am sure this is really simple, but I am trying to select the only one row of data with multiple columns based on the value in one of the columns.
For example, I have the following data
Shipment | Event Type | Date Occured | Date Submitted |
---|---|---|---|
12345 | Estimated delivery | July 1, 2013 | June 25, 2013 |
12345 | Estimated delivery | June 30, 2013 | June 24, 2013 |
abcde | Actual delivery | June 14, 2013 | June 14, 2013 |
abcde | Estimated delivery | June 14, 2013 | June 10, 2013 |
but I would like to get only the most recent date occured per shipment, per event type. see below.
Shipment | Event Type | Date Occured | Most recent Date Submitted |
---|---|---|---|
12345 | Estimated Delivery | July 1, 2013 | June, 25, 2013 |
abcde | Actual Delivery | June 14, 2013 | June 14, 2013 |
abcde | Estimated Delivery | June 14, 2013 | June 10, 2013 |
I thought I could do something like
New Table:
noconcatenate
load distinct
[Shipment],
[event type],
[Date occured],
max([date Submitted]) as [most recent date submitted]
resident old table
group by [shipment],[event type], [date occured];
however since the date occured is different, I get two rows... I cant guarantee that the date something occured is the larger or smaller. In other words the date submitted has nothing to do with when it was submitted or previous dates, it can go up or down. I just need to only capture the most recent one.
Any help would be appreciated.
Thanks
Not sure I understand why you would need a developer to do simple thing like showing the max to take your data from multiple rows to single rows per max ? Is Qlikview not capable of multi-dimensional analysis?
This should be a function of the properties in sheet objects, like other tools.