Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

if my min day varies how do I set it on a formula?

My min date on a table varies by part number and represents the first date the part was manufactured so I can't set a defined number for the start date. Is there a formula/script to look up the first date the part was manufactured and set that as my min date and have my max date be today (the date selected)? This should give me a total manufactured from the first date to the date selected.

Thanks for the help,

Venus

3 Replies
swuehl
MVP
MVP

Venus,

where do you want to use the min date per part number and the date selected (in which context, chart)?

What do you want to show?

Could you post some sample lines of your data togehter with the expected outcome?

tresesco
MVP
MVP

Hello Venus,

As swuehl has indicated that it would have been better to understand your requirement, had you posted some sample. Still, here are some options you can try based on your requirement:

You can use aggregation function MIN like,

LOAD

          part number,

          MIN(DateField) as MinDate,

          .....

FROM .....GROUP BY part number ...;

or if you need a single minimun date from the entire table, you can try something like,

LOAD part number,

          DateField,

          ......

FROM ...... ORDER BY DateField;

then use peek function - PEEK('DateField',0) to get the minimum date and store in a variable.

Hope this helps.

Regards,

tresesco 

Anonymous
Not applicable
Author

... and, if you want to use it on front end rather than in script, use aggr:

aggr(min(DateField),"Part Number")