[ABUSE] By: ruhana / Board: forumsmisc (4629)

Options
damianAP
damianAP Member, ALL USERS, Employee, Certified Model Builder Posts: 5 Contributor
Not really applicable for this post.


Link to post:
(Re: Data Export with Filters)

by ruhana



https://community.anaplan.com/t5/Anaplan-Platform-Discussions/Data-Export-with-Filters/m-p/42611#M4629



<p>Filtering Entries During Import or Export</p><div>&nbsp;</div><div class="sticky-wrapper"><div class="to-top sticky">&nbsp;</div></div><p>You can customize your snapshot by filtering entries during the import or export of a region or a cache.</p><p>For example, use filters to limit the export of data to a certain date range. If you set up a filter on the import or export of a cache, the filter is applied to every single region in the cache.</p><p>The following example filters snapshot data by even numbered keys.</p><pre>File mySnapshot = ...
Region&lt;Integer, MyObject&gt; region = ...

SnapshotFilter&lt;Integer, MyObject&gt; even = new SnapshotFilter&lt;Integer, MyObject&gt;() {
@Override
public boolean accept(Entry&lt;Integer, MyObject&gt; entry) {
return entry.getKey() % 2 == 0;
}
};

RegionSnapshotService&lt;Integer, MyObject&gt; snapsrv = region.getSnapshotService();
SnapshotOptions&lt;Integer, MyObject&gt; options = snapsrv.createOptions().setFilter(even);

// only save cache entries with an even key
snapsrv.save(mySnapshot, SnapshotFormat.GEMFIRE, options);<br /><br />learn more &nbsp;<a href="https://onlineitguru.com/tableau-online-training-placement.html" target="_blank" rel="noopener">https://onlineitguru.com/tableau-online-training-placement.html</a></pre><p>&nbsp;</p>



This message has 0 replies