I'm having trouble in getting this around. So I've loaded a table from several sources that need to follow these conditions in script:
I've created a flag column, either 1 or 0. If Receipt Number (column) counts more than 1, then only show the row containing 1, else show 0.
The resulting table has to be with distinct values in Receipt Number, always.
I've tried using max() in flag column, but it only works partially. There are still non-distinct Receipt Numbers. Also tried an if condition where if(count("Receipt Number")>1, flag=1, flag) but doesn't work.