Skip to main content
Announcements
See why Qlik was named a Leader in the 2024 Gartner® Magic Quadrant™ for Data Integration Tools for the ninth year in a row: Get the report
cancel
Showing results for 
Search instead for 
Did you mean: 
jhstrange
Contributor II
Contributor II

Importing a CSV file which has multiple similar column names

Employee No.Check No.Check DateItem CountItem No.Pay TypePay CodeAmountDescUnitsRateItem No.Pay TypePay CodeAmountDescUnitsRate    

 

Hello, I have a CSV file in the above format. When I import into Qlik, the fields in Bold are being considered as Item No,Item No.2, Pay Type , Pay Type 2, etc based on the value of Item Count.

Let us say I have a record for which Item count is 5. Is there a way to have 5 different records/rows in CSV with each record having details like Pay Type, Pay Code, etc linking to Emp no, Check no and Check Date instead of a very long column list. Please see below:

Original format:

Employee No.Check No.Check DateItem CountItem No.Pay TypePay CodeAmountDescUnitsRateItem No.Pay TypePay CodeAmountDescUnitsRate
yyzz200910122#012abc  xREG PAY    na#026defyFWH       mb

 

Required Format:

Employee No.Check No.Check DateItem CountItem No.Pay TypePay CodeAmountDescUnitsRate
yyzz200910122#012abc  xREG PAY    na
yyzz200910122#026defyFWH       mb

 

If the "Required Format" is achievable in CSV 1)before uploading to Qlik or 2)by scripting in Qlik, it would make dash boarding/reporting aspects easier in Qlik.

Any help would be appreciated, thank you.

Labels (2)
2 Replies
StarinieriG
Partner - Specialist
Partner - Specialist

Hi

maybe you could use something like this

 

TABLE:
LOAD [Employee No.],
[Check No.],
[Check Date],
[Item Count],
[Item No.],
[Pay Type],
[Pay Code],
Amount,
Desc,
Units,
Rate
FROM
your csv;

FOR i = 1 to 4 (you have to set max number as your max -1, so if you have 5 different rows, you have to use 4 )

Concatenate
LOAD
[Employee No.],
[Check No.],
[Check Date],
[Item Count],
[Item No.$(i)] as [Item No.],
[Pay Type$(i)] as [Pay Type],
[Pay Code$(i)] as [Pay Code],
Amount$(i) as Amount,
Desc$(i) as Desc,
Units$(i) as Units,
Rate$(i) as Rate
FROM
your csv;

NEXT

jhstrange
Contributor II
Contributor II
Author

Hello,

I have noticed that our Qlik Sense enterprise version apps which have never given any trouble have acted funky a couple of times in the past day or two. It gives a message 'Internal Engine error' once in a while(not always) and then I have to close the tab and reopen to continue my work.

Any help or suggestions would be highly appreciated as it is imperative for people to have continuous access to closely look at data.

 

Thanks in advance.