Hi I have a dataset and I have to save it only if it has value and if the data is not there then I should not overwrite the old data
Example:
Scenario 1.
In the below condition we should overwrite yesterdays file because it has value
name | place | city |
james | UK | london |
Clark | USA | NY |
Scenario 2.
2nd a scenario where all the columns are empty, here I should not overwrite it
name | place | city |
Scenario 3.
3rd scenario everything is null, here I should not overwrite it
Note: In Scenario 2 and scenario 3 I should get an error message and stop the canvas
@Sshasnk I like to use the Transpose and Crosstab tools for things like this.
First, if your data doesn't already have a row number, add one with the Record ID.
Then, transpose your data so it is in Name:Value pairs
Then, use a filter, to remove any rows where the Value is empty
Next, group by the Name field and this will be the names of the columns that had data in them.
Next, join that list of names to the data after it was Transposed.
Be sure to remove the duplicate field.
Now, you can use the Crosstab to get the data back into the format it was before we moved things around. This is what you would use to overwrite data. If there is no data, then nothing to overwrite.
it will still overwrite and you will get empty values in your column
Can you post your workflow? I must not be understanding your description.
@Sshasnk ,
Use the Message tool and the Count Records tool.
This will give a count of records present. Simply attach this to the Message tool and configure as follows:
This will throw an error and tell you there are no records present.
Hope this helps,
M.