How to replace empty fields

Hello guys, I need help with something that is surely simple, but I can’t find the solution, in a table, the tags field contains “empty” and in other cases it has information about the tags, that information is attached to the Publishdate and direction fields, I need that in cases where there is empty in tags, it is replaced by information that is not “empty”
In the image I show the table as I have it now and as I need to have it, in yellow I want to highlight the cells that I want to modify, what calculated field would I need to do or what function?

Hi @Jesus -

You can use the table functions of lastValue & firstValue for this.

Step 1 - Create a calculated field that changes “Empty” to NULL.
This will put the null values first, used for order by in step 2.
c_tags

ifelse(Tags='Empty',NULL,Tags)

Step 2 - Create a calculated field to retrieve the last Tags value and partition by InitialPublishDate
Note: You will probably need to adjust this… I wasn’t exactly sure what partitioning is needed for your use case.
c_last_tags

lastValue({c_tags},[{c_tags} ASC], [InitialPublishDate])

Step 3. Add c_tags and c_last_tags to your table visual. Hide c_tags column
image

Result:

1 Like