Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
siva0606
Contributor III
Contributor III

Production Vs Manufacturing Issue

Hi all,

I have a "HL" type code in Production table

and "S"type code in Manufacturing table

Both Prod and MFG is linked by ItemCodekey(ItemCode&'-'&Year&'-'&Month)

Production:

ItemCodeProductionQty
WNU012H268542
WNU012L27517
VNU012H21780
VNU012L20764

Manufacturing:

ItemCodeManufacturing Qty
WNU012S28063
VNU012S21511

Most important is I need to split the Item Code in MFG table

WNU012S as WNU012H and WNU012L

Similarly,VNU012S as VNU012H and VNU012L and both H and L should get the same value of S

and my final table should look like this

ItemCode
ProductionQty
Manufacturing Qty
To be Packed
WNU012H2684228063-1221
WNU012L2751728063-546
VNU012H2178021511269
VNU012L2076421511-747

FYI: To be Packed= ProdQty-MFGQty

With Kind Regards,

Shiva

Labels (1)
1 Solution

Accepted Solutions
alexandros17
Partner - Champion III
Partner - Champion III

Try this code, you can optimize it with a loop but it works as is:

Production:

LOAD * Inline

[ItemCode,ProductionQty

WNU012H,268542

WNU012L,27517

VNU012H,21780

VNU012L,20764

]
;



Manufacturing_tmp:

NoConcatenate

LOAD * Inline

[ItemCode,ManufacturingQty

WNU012S,28063

VNU012S,21511

]
;



Manufacturing:

NoConcatenate

LOAD

if(right(ItemCode,1)='S',left(ItemCode,len(ItemCode)-1) & 'H',ItemCode) as ItemCode,

ManufacturingQty

Resident Manufacturing_tmp;     



Concatenate



LOAD

if(right(ItemCode,1)='S',left(ItemCode,len(ItemCode)-1) & 'L',ItemCode) as ItemCode,

ManufacturingQty

Resident Manufacturing_tmp;     



DROP Table Manufacturing_tmp;

View solution in original post

2 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Try this code, you can optimize it with a loop but it works as is:

Production:

LOAD * Inline

[ItemCode,ProductionQty

WNU012H,268542

WNU012L,27517

VNU012H,21780

VNU012L,20764

]
;



Manufacturing_tmp:

NoConcatenate

LOAD * Inline

[ItemCode,ManufacturingQty

WNU012S,28063

VNU012S,21511

]
;



Manufacturing:

NoConcatenate

LOAD

if(right(ItemCode,1)='S',left(ItemCode,len(ItemCode)-1) & 'H',ItemCode) as ItemCode,

ManufacturingQty

Resident Manufacturing_tmp;     



Concatenate



LOAD

if(right(ItemCode,1)='S',left(ItemCode,len(ItemCode)-1) & 'L',ItemCode) as ItemCode,

ManufacturingQty

Resident Manufacturing_tmp;     



DROP Table Manufacturing_tmp;

siva0606
Contributor III
Contributor III
Author

It works.Thank you so much.