<script src="https://cdn.flexmonster.com/flexmonster.js"></script>
<div>
<h2>How to create multiple fields from one field</h2>
<p>
For JSON and CSV, you can create multiple fields from one field in the
<code>dataSource.mapping</code> object. Created fields can be used
separately in the slice.
</p>
<p>
In this example, we've created <code>Date (hierarchical)</code> and
<code>Date (string)</code> fields from <code>Date</code> (lines 8-21 in the
JavaScript box). Use the buttons below to switch between these fields.
</p>
<p>
<a
href="https://www.flexmonster.com/doc/mapping/#!splitting-fields"
target="_blank"
>Visit our docs to learn more about this feature</a>.
</p>
</div>
<button onclick="setSlice('hierarchical')">Use hierarchical dates</button>
<button onclick="setSlice('string')">Use string dates</button>
<div id="pivot-container"></div>