Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using the latest date from a list of dates

I have a bar chart that looks at serial number movements. The Dimension is Date Shipped.

The expression I have currently returns mutiple dates for a single serial number. I need to only select the latest date, and count this (ie the count on each serial number should always be one).

A further complication is that I am using a variable (vDate) for Date Selected. The date to be counted must always be less than vDate

This is my expression: Count(If(TYPE='S',Date Shipped))

I'm new to QlikView - any assistance would be really appreciated.

2 Replies
Not applicable
Author

Count(aggr(max({$<Date Shipped={"<$(=$(vDate))"},Type={'S'}>}Date Shipped),Serial Number))

This should return only the highest date per serial that is less than vDate and has Type=S.

Not applicable
Author

I tried that but it didn’t work: it seemed to be counting all the serial numbers. Maybe I didn’t explain well enough.

For one serial number, my selection might return 4 different stock movement dates. I need to select the latest one, but the count has to be on date, as my graph uses that as the dimension.

It shows the number of stock movements split by date, for a subset of serial numbers.

Thanks