Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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
Tags (1)
1 Solution

Accepted Solutions
Not applicable

Re: Combining numerous fields into one

try to use

crosstable(week,Quantity,2)

3 Replies
Not applicable

Re: Combining numerous fields into one

try to use

crosstable(week,Quantity,2)

er_mohit
Not applicable

Re: Combining numerous fields into one

See the attached file

Not applicable

Re: Combining numerous fields into one

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

Thanks,

Ralph