Hi,
I have a dataset with three fields (along with lot of other fields) : id, created, status.
Status can have two values for a particular id: error, success.
There could be multiple records for a single id with status of error or success.
I need to know if there is a success status for an id.
Example : If an id has 1 or more errors and finally 1 success, I need to count this as 1 successful_retry.
If an id has 1 success with no previous errors, it is not counted towards a successful_retry, but counted once towards successful_first_time_itself.
If an id has 2 errors with no success, it is counted twice towards error_count.
In my analysis, I am trying to create a calculated field with below expression and trying to show it in a table along with other fields.
lastValue({status},[{created date}],[{id}])
This is not working, as it seems that this is an aggregated field but not a field at individual record
level.
I also tried calculated field with below expression, thinking it would give me the value at individual record level, so I can compare status value with previous record’s status value. However, this also seems to be an aggregated field.
lag({status},[{created} ASC],1,[{id}])
If I setup similar fields directly in my dataset custom SQL using window functions, it works just fine. Why do they not work at the analysis level? Is there a way to have window function equivalents at the analysis level? I do not want to keep modifying my dataset custom sql whenever a new analysis is needed that mandates window functions.
Any help is appreciated.
Thanks in advance.