I was hoping to make a table out of a CSV which I thought had quite a simple structure: Name, %, Number, Number
Here is an example of the data in my CSV: UNITED STATES, 18.3%, 42.07, 3.51
But wpDataTables is rendering that as an integer as: UNITED STATES, 183, 4.207, 351
If I set it as a string then it reflects the numbers I expected but it cannot be sorted so that’s no good. Setting the column to Float just adds decimal places after the figures but ignores the decimal point in the CSV.
The same thing happens if I import the data as XLSX.
I’m obviously doing something quite obvious wrong because this is surely quite basic functionality. I do see someone else happens to be wrestling with percentages which is a similar issue but not identical so I have posted this separately.
Firstly, I would like to sincerely apologize for the delayed response as we have been experiencing an unusually high number of tickets. I am sorry that it has taken longer than usual to respond to your concern and your patience is highly appreciated.
There are several important points to be aware of when working with a CSV in our Plugin.
1. Firstly, make sure not to use duplicate header names in origin Headers for columns.
If you make a duplicate?Header name for one or more columns, our Plugin only takes the first occurence and ignores the other, duplicate column Header. So for column “Number” duplicate header, just add anything, in this case we add space and letter B (“Number B”) just to have it generate the table with three Columns and later we go in the Column Display settings and change the “Displayed?Header” to the duplicate, now it shows both as?“Number”.
So the original Header row in the CSV is like this?:
?Name, %, Number, Number B
?The first row of data will be like :
UNITED STATES, 18.3, 42.07, 3.51
and second row, we added just to test sorting for numerical/floats :
?Serbia, 10.02, 02.83, 5.33
?
We change the “Number B” Displayed Header to “Number” in order to have them both as duplicate Header in the Table visually.
2. Make sure to set our CSV delimiter to comma in Main Plugin Settings.
3. The Number Format for Floats is set to the US Format ( comma for thousands separator, dot for decimal separator).
4. One more important point, remove the percentage symbol from any numeric data if you need it to render as Floats ( or integer).
Then in our Plugin’s column display settings, simply add it as suffix.
And this is how a new Table connected to this CSV looks. The sorting for Floats also works.
We recorded a Video demonstration, so you can see how it looks bad if we change the CSV delimiter or wrong Number Format, etc, you can download it here.
Let us know if that helped to fix the issues when you follow these pointers or if you still encounter any issue?
If there is still an issue, it is best to first record a Video of your screen to show us the exact steps you do when you are creating the Table and how are all these settings configured on your Plugin installation.
Then, send us your CSV source file here so we can inspect if it has some specific formatting or anything like that which we did not take into account to try and reproduce the issue, etc.
If the Video or CSV does not contain any sensitive data, you can just upload to weTransfer and send us a download link.
Or if it shows any sensitive data, please open a ticket on our main Support platform here and one of our Agents will respond as quickly as possible to help you with further troubleshooting.
If you don’t have a licence (or if it expired), please open a pre-purchase ticket which doesn’t require a purchase code.
Thank you for understanding.
Viewing 1 replies (of 1 total)
The topic ‘Data from CSV not displaying as I’d expect’ is closed to new replies.