Date source is CSV fetched from API.
API returns date columns in the format dd-MMM-yyyy. Ex: (...,11-Nov-2019,...)
How to handle this in flexmonster UI so that when the drill through report is exported to excel, the date columns will retain their data type as date in excel instead of plain text?
Hello,
Thank you for writing to us.
We would like to mention that data representing dates needs to be specified in the ISO 8601 date format.
At the moment, in Flexmonster date fields represented as measures retain their data type as date when exported to Excel.
Here is a JSFiddle example for illustration: https://jsfiddle.net/flexmonster/s48e6jah/
Please let us know if this works fine for your use case.
Best Regards,
Vera
Thanks. As per your example where should i include below code?
data: [
{
"date":{"type":"datetime"},
"n":{"type":"number"}
},
My implementation is in typescript is as below
public pivotReport: any;
this.pivotReport = {
dataSource: {
dataSourceType: “ocsv”,
filename: Url,
},
slice: {
reportFilters: [],
rows: [],
columns: [],
measures: [
],
drillThrough: []
},
};
Hello,
Thank you for your reply.
For CSV/OCSV data sources a special prefix needs to be added to the field column name.
Please see our data types in CSV tutorial for guidance.
The prefixes specify how data should be interpreted by Flexmonster.
In case data is fetched from SQL database, we kindly suggest setting the Flexmonster data types prefix dt+
explicitly via SQL query alias.
Here is an example:
"SELECT segment as 'Segment', post_date as 'dt+Post Date' FROM customers"
Please let us know if it works for you.
Best Regards,
Vera