Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Combining numerous fields into one

Hello,

I am extracting data from a SQL database and am wanting to combine a number of fields into one, which would have to be grouped by a period (see Table1 below). The below shows a forecast quantity per week for each product and rather than having a seperate field per week I want to combine them and then create a new field which would now be the week (e.g. Table2). The problem I have is that the database has data from 2000 up until 2015, and this will continue to expand over time, and my initial solution of concatenating a week at a time would not be sustainable or efficient.

Thanks,

Ralph

Table1:

ProductRegion201335201336201337201338201339201340201341201342
ChickenUK3035303414354021
EggsUK400400500350400300450140
BeefUS3555555560234534

Table2:

ProductRegionWeekQuantity
ChickenUK20133530
EggsUK201335400
BeefUS20133535
ChickenUK20133635
EggsUK201336400
BeefUS20133655
ChickenUK20133730
EggsUK201337500
BeefUS20133755
1 Solution

Accepted Solutions
Not applicable
Author

try to use

crosstable(week,Quantity,2)

View solution in original post

3 Replies
Not applicable
Author

try to use

crosstable(week,Quantity,2)

er_mohit
Master II
Master II

See the attached file

Not applicable
Author

Thanks, I didn't even think about using a Crosstable.

Thanks,

Ralph