Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
How would you create a script that loads this type of table?
Year | 2011 | 2012 | 2013 | |||
Customer | Sales | Customer | Sales | Customer | Sales | |
Nike | 55,000 | SuperDry | 12,000 | Numa | 90,000 | |
Adidas | 600,000 | Box | 43,000 | Reebok | 85,000 | |
Puma | 64,000 | Train | 65,000 | Kel | 81,000 |
It is not in a great format a computer can read easily so checking with you
Hi John,
I want your example to describe the approach as such data can be loaded. This is just a variant of how you can use the transformation step when loading such files.
Initial data
Open file wizard
Set the "Embedded Lebels"
Next, go to the transformation step
Next, the sequence of movements can be different. Consider one of them.
Go to the tab "Unwrap" and select cursor boundary between 2 and 3 fields
click select the border (it turns blue) and press the button "Unwrap"
The same action is repeated for the rightmost two fields. We obtain the following
Next, add a new column "Year". To do this, go to the tab "Column" and push button "New..."
In the dialogue window that opens, set the flag "Replace Null Value with Previous Value" and push button "Cells from these rows..."
In the dialogue window that opens, set the "starts with" and "20", then sequentially presses the button "Add" and "Ok" and next dialogue window "Ok" also.
We obtain the following
Next, go to the tab "Garbage", cursor select line to be removed and presses the button "Delete Marked".
Result
After presses the button "Next" rename the field "Year" in the next dialog box, remove the unnecessary field and press the button "Finish" (For our example, we did all the action).
The script editor received the following code snippet
After loading the following internal table is obtained
In this example, I just wanted to show how you can work with the step transformation QlikView.
I will be glad if you could help.
Regards,
Andrey