We are trying to use the Last_version filter in an aggregated table to get the counts of ID's for the last audit date for that ID. (v5.2.2)
This use case is generating some values but they dont seem to make any sense. We are unable to understand the logic that incorta is using to apply this function.
As there was limited documentation for the feature, it would be helpful if you could provide more insight on the workings of this filter.
Sorry misunderstood the question that you were using the lastVersion() function. Please refer to Patrick reply for the correct answer
You can use the lastVersion() filter function as follows:
firstVersion(<type> value, <type> group_by, date order_by)
Type of value
Returns the last occurrence of a value with respect to date (i.e. the order-by parameter). Unless used as a filter, this function must be used inside an aggregation function.
count(lastVersion(SALES.SALES.AMOUNT_SOLD, SALES.SALES.CUSTOMER_ID, SALES.SALES.AUDIT_DATE))
more in the doc link: https://docs4.incorta.com/4.5/c-filter-functions/#example
Do you want to share sample of your data and screenshot of your analyzer. The result is impacted by the grouping dimensions used in your aggregated table.
If I take this example of source data:
Think of that table as a record of orders (there are 3 above) that are placed, and then updated over time. I might apply a Last Version filter (or a First Version filter) to retrieve only the "last version" of the order:
To do that in Incorta, it would look like this:
You drag on the "id" field into Individual Filter panel (think of it as the unique key of the result set or the group by), set the Operator to "Last Version" and then drag the Order Date on to the Values (think of it as the criteria by which we select the row that aligns to that unique key).
Hope that helps, this screenshot comes from an Incorta cloud instance if you wanted to take a look.