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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Min(Year) as a dimension in the script editor

Hi ,

I have a list of products and the month/year that they were first launched...

I want to see the min year of this.

I can calculate this simply using min(Year) as an expression in a pivot table. However I want this to be calculated in the script editor as a dimension so that I can use it in a pivot table -

any ideas?

Thanks

1 Solution

Accepted Solutions
Peter_Cammaert
Partner - Champion III
Partner - Champion III

I'm not sure if I completely understand your requirement (it's rather slim on details), but let's assume that the use date is present in a facts table, together with the product ID (let's call that one Material). Then in your script, add the following after you load the facts:

LEFT JOIN(Facts)

LOAD Material, min(Year(UseDate)) AS FirstYearUsed

RESIDENT Facts

GROUP BY Material;

Best,

Peter

View solution in original post

2 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

I'm not sure if I completely understand your requirement (it's rather slim on details), but let's assume that the use date is present in a facts table, together with the product ID (let's call that one Material). Then in your script, add the following after you load the facts:

LEFT JOIN(Facts)

LOAD Material, min(Year(UseDate)) AS FirstYearUsed

RESIDENT Facts

GROUP BY Material;

Best,

Peter

Not applicable
Author

Lovely job - thanks