Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Simple one I hope. I have created a duplicate flag in the script which the load does not like. Is there something wrong with the formula or can it simply not be done???
if(count(EpisodeNumber) - Count(distincEpisodeNumber) >1,1,0) as DuplicateEpisode_Flag,
Thanks!
You would need to aggregate your count first:
DistinctEpisode:
load distinct EpisodeNumber
resident <YourTable>;
let vDistinctEpisodeNum=NoOfRows('DistinctEpisode');
drop table DistinctEpisode;
Table:
load
<Dim1>,
<Dim2>,
count(EpisodeNumber)as EpisodeNumber
resident <YourTable>
group by
<Dim1>,
<Dim2>;
Data:
load *, if(EpisodeNumber-$(vDistinctEpisodeNum)>1,1,0)as DuplicateEpisode_Flag
resident Table;
drop table Table;
drop table <YourTable>;