Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey guys,
I'm trying to load the following script into Qlikview:
Load
[Client Name] As Client_Name,
[Account Number],
[Portfolio Name],
if(len(Client_Name) = 0, 'Fail','Pass') as Client_Name_No_Data
// if([Client Name] = "0", 'Fail','Pass') as Client_Name_Wrong_Data,
// if(sum([Client Name]) > 0, 'Numerical','Alphabetical') as [Alphabetical/Numerical],
From
Having issues as it wont recognise the 'Client Name'. I've tried it without renaming [Client Name] As Client_Name as well. When loading with out the If Statement - it works fine.
Can anybody assist please?
Kind Regards
Mav
Try:
if(len([Client Name] ) = 0, 'Fail','Pass') as Client_Name_No_Data
Try:
if(len([Client Name] ) = 0, 'Fail','Pass') as Client_Name_No_Data
Hey guys,
That seemed to have worked, but I encountered another issue. The below statement returns an error in the statement which I cant seem to locate.
if(sum([Client Name]) => 0, 'Numerical','Alphabetical') as [Alphabetical/Numerical]
Sum is an aggregation function. If you use one, there has to be a 'Group By' clause. Are you using that? What is the error message you are getting?
Error in expression ')' expected. No I haven't used group by? I'm fairly new to scripting in QV altogether.
Please post your sample app or atleast the script section
LOAD [Client Name],
[Account Number],
[Portfolio Name],
[Transaction Identifier],
[Firm’s Internal Transaction Reference],
[Transaction Date],
[PO Instrument Name],
[FCA Qualified Transaction],
[FCA Non Qualified Transaction Reason],
[FCA Sent Transaction],
[FCA Rejected Transaction],
[Transaction Type],
[Instrument Type],
IPO,
[Trading Capacity],
[Trading Exchange],
[Account Type],
if(len([Client Name]) = 0, 'Fail','Pass') as Client_Name_No_Data,
if([Client Name] = 0, 'Fail','Pass') as Client_Name_Wrong_Data,
if(sum([Client Name]) => 0, 'Numerical','Alphabetical') as [Alphabetical/Numerical]
FROM
If you are only checking if the client name is a text or number then don't use sum() function. Try like:
if( IsNum([Client Name]), 'Numerical','Alphabetical') as [Alphabetical_Numerical]
It worked!
Fantastic!
Much appreciated!