Scenario
10: How to create empty extract?
For
large extracts, though, it can be quite time-consuming to create a
desktop version before publishing to the server. Understandably,
customers often ask if there’s a way to “just have Server do it.”
The
first step is to establish a Boolean parameter for a little control:
Show
the parameter control in the workspace for easy toggling.
Next,
we’ll need a calculated field to expose the chosen value.
Now
we define our extract, using the above calculation as a filter.
The
trick here is to exclude
the
exposed value (“True”, in this case), because we need this
condition to evaluate
false immediately.
The goal, after all, is for no rows to be returned.
Our
extract definition now looks like this:
Hit
Extract,
select a location for the .tde file, and the process should be
finished in seconds. We now have an extract with no data in it at
all.
Next,
we'll move this content – perhaps in the form of a reusable data
source – to the server. The critical step is to flip the parameter,
like so…
…and
publish.
The
published version doesn't contain the forced fail condition in the
extract definition, so any refresh – immediate or on a schedule –
will populate the extract in full.
The
above technique is more appropriate for an extract that is part of a
shared data source than one living within the context of a workbook.
This is because we’re likely to need the extract at the beginning
of the development cycle, and employing Data Server in our work flow
is an obvious path.