Creating CSV Files
When working with mpmX applications, it can be useful to understand at its core how data needs to be formed so that it can be uploaded from the Client and processed, for instance by our Import Wizard.
What is a CSV File
A CSV file (short for Comma-Separated Values) is a simple and versatile format used to organize and exchange structured data. In these files, values are separated by commas (or sometimes other delimiters like tabs or semicolons), making them easy to read and compatible with many applications like Microsoft Excel, and various database tools.
Example
Product, ID, Category, Price
101, Monitor, Electronics, 199.99
104, Water Bottle, Sport, 14.99
108, Curtain, Decoration, 8.99
- The csv File is like a table. The first row is the header and represents the labels for the data in each column. Having a row for headers is optional!
- Each subsequent row represents a record that corresponds to those headers i.e. Rows of Data.
- Within each row, the values are separated by your chosen delimiter which is most likely a comma (,) or a semicolon (;). These values correspond to columns in your dataset.
Checklist for an ideal CSV File for import into Qlik
1.File Format
- Use UTF-8 encoding for the file.
- Save the file in CSV format (Comma-Seperated Values)
2. Structure
- The first row should contain field headings.
- Use meaningful column names, ideally identical/similar to the target fields in Qlik.
- Avoid special characters and umlauts (ä,ö,ü) in the column names.
3. Separators
- Use a consistent separator, preferably semicolon (;) or comma (,).
- Make sure that the selected separator does not appear in the data values.
- If this should be the case, it is absolutely necessary to enclose the fields in double quotation marks ("").
4. Text Limitation
- Enclose all fields in double quotation marks (“”).
- This is particularly important for fields that could contain the separator character.
- We do not recommend the use of line breaks within fields.
5. Row Length
- Keep each row under 1 million characters to avoid automatic line breaks.
6. Consistency
- Make sure that each row has the same number of fields.
- Fill empty fields with an empty value between the separators (" ")
7. Data Quantity
- Please note the upload limits of Qlik
- Qlik Cloud: 4 MB standard, expandable up to 64 MB depending on version/account/contract)
8. Pre-Processing
- Clean the data of obvious errors or inconsistencies before importing.
Example of an ideal CSV Structure
EventID;CaseID;ActivityName;UserName;ActivityStartTimestamp;ActivityEndTimestamp;CaseDimension1;CaseDimension2;CaseDimension3;CaseDimension4;CaseDimension5;EventDimension1;EventDimension2;EventDimension3;CaseValue1;CaseValue2;EventValue1;EventValue2;Geofield;Ressource
1;1;Assign seriousness;User 1;2012-10-09 14:50:17.000000000;2012-10-09 14:50:25.600000000;Variant 12;12;Variant 12;Value 1;Value 1;Value 1;Value 1;Value 1;0,457;16,180;1,599;1,843;Karlsruhe;Ressource1
2;1;Take in charge ticket;User 1;2012-10-09 14:51:01.000000000;2012-10-09 14:57:01.600000000;Variant 12;12;Variant 12;Value 1;Value 1;Value 1;Value 1;Value 1;0,976;13,943;18,062;3,081;Karlsruhe;Ressource2
3;1;Take in charge ticket;User 2;2012-10-12 15:02:56.000000000;2012-10-12 15:04:23.666666666;Variant 12;12;Variant 12;Value 1;Value 1;Value 1;Value 1;Value 1;0,677;15,805;1,937;0,699;Karlsruhe;Ressource2
4;1;Resolve ticket;User 1;2012-10-25 11:54:26.000000000;2012-10-25 12:40:36.000000000;Variant 12;12;Variant 12;Value 1;Value 1;Value 1;Value 1;Value 1;5,909;14,305;19,473;2,408;Karlsruhe;Ressource3
5;1;Closed;User 3;2012-11-09 12:54:39.000000000;2012-11-09 13:45:18.000000000;Variant 12;12;Variant 12;Value 1;Value 1;Value 1;Value 1;Value 1;5,470;16,070;11,364;1,208;Karlsruhe;Ressource4
6;2;Assign seriousness;User 4;2012-04-03 08:55:38.000000000;2012-04-03 08:55:41.500000000;Variant 1;1;Variant 1;Value 1;Value 2;Value 2;Value 1;Value 1;8,746;9,500;9,685;4,959;Karlsruhe;Ressource1
7;2;Take in charge ticket;User 4;2012-04-03 08:55:53.000000000;2012-04-03 09:06:51.250000000;Variant 1;1;Variant 1;Value 1;Value 2;Value 2;Value 1;Value 1;6,784;1,565;11,431;0,452;Karlsruhe;Ressource2
8;2;Resolve ticket;User 4;2012-04-05 09:15:52.000000000;2012-04-05 09:34:21.000000000;Variant 1;1;Variant 1;Value 1;Value 2;Value 2;Value 1;Value 1;3,287;26,935;11,114;0,459;Karlsruhe;Ressource3
9;2;Closed;User 5;2012-05-19 09:00:28.000000000;2012-05-19 09:03:43.666666666;Variant 1;1;Variant 1;Value 1;Value 2;Value 2;Value 1;Value 1;3,526;16,643;6,057;1,099;Karlsruhe;Ressource4
10;3;Assign seriousness;User 6;2010-10-29 10:14:06.000000000;2010-10-29 10:15:06.800000000;Variant 1;1;Variant 1;Value 1;Value 3;Value 3;Value 1;Value 2;8,934;9,717;1,597;4,975;Karlsruhe;Ressource1