Qlik Community

Qlik DataMarket Discussions

Discussion Board for collaboration regarding Qlik DataMarket.

Not applicable

Trim function

Hi,

Can anybody will help me to understand below given script pls.

upper(if(left(TRIM([Ship to party]),1)='N',[Ship to party Name],'Direct_Sale')) as WH,

  trim([Actual GI date]) as Day,

  left(trim([Actual GI date]),2)*1 as Date,

  right(trim([Actual GI date]),7)*1 as Month,

  if(left([Ship to party],1)='N',[Ship to party Name],[Plant Name]) as [Reciving palnt]

FROM *_ZSD_0047.XLS (biff, header is 6 lines, embedded labels, table is [zsd_0047$])

WHERE(IsNum(Delivery));

1 Solution

Accepted Solutions

Re: Trim function

Good. If you got what you were looking for, I would suggest closing the thread down by marking correct answer

3 Replies

Re: Trim function

Are you wondering why the script might be using the Trim Function? I think the data might contain white spaces before or after the actual values which can be used using Trim function here. With regards to the specific code:

upper(if(left(TRIM([Ship to party]),1)='N',[Ship to party Name],'Direct_Sale')) as WH, 

Checking if the first letter of [Ship to party] field is N, if it is assign the value to a new field called WH the value from the field [Ship to part Name], else call is Direct_Sale.

Do you need the same explanation for all the lines of code or do you get an idea of where I am going?

Not applicable

Re: Trim function

I got that.

Thankyou so much for your help.

Re: Trim function

Good. If you got what you were looking for, I would suggest closing the thread down by marking correct answer

Community Browser