Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello I got a table on my datasource with the following structure and sample data
USERID Brand Stock
12 1,2 12,5,6
13 1,3,4
...
Actually the values 1,2 under the brand column refer to two brand keys
so I want to get this table to QlikView as follows:
UserBrand:
USERID Brand
12 1
12 2
13 1
13 3
13 4
UserStock:
UserID Stock
12 12
12 5
12 6
may you please help me with the script that accomplishes this?
Here is a script which accomplishes this:
OrigData:
LOAD * Inline [
UserID, Brand, Stock
12, '1,2', '12,5,6'
13, '1,3,4'
];
UserBrand:
LOAD UserID, SubField(Brand,',') as BrandExpanded
Resident OrigData Where Len(Brand) > 0;
UserStock:
LOAD UserID, SubField(Stock,',') as StockExpanded
Resident OrigData Where Len(Stock) > 0;
Here is a script which accomplishes this:
OrigData:
LOAD * Inline [
UserID, Brand, Stock
12, '1,2', '12,5,6'
13, '1,3,4'
];
UserBrand:
LOAD UserID, SubField(Brand,',') as BrandExpanded
Resident OrigData Where Len(Brand) > 0;
UserStock:
LOAD UserID, SubField(Stock,',') as StockExpanded
Resident OrigData Where Len(Stock) > 0;
Hi,
Load data some thing like
UserBrand:
Load * inline
[
USERID, Brand
12, 1
12, 2
13, 1
13, 3
13, 4
];
UserStock:
Load * inline
[
UserID, Stock
12, 12
12, 5
12, 6
];
What is your actual requirements please clear it.
Regards
Anand
Hi Ali,
Please check in the attached file.
Do let me know if this one help you.
Regards,
Sokkorn