Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I'm new to Qlikview and i'm trying to put an expression in the load script for the 1st time and i can't work out why it's not working. Please could you help?
I am loading the following expression:
Transactions:
load *,
if ([Behavior Score Criteria] = 'Samples_Form_Lit_Request',if(count(Material_Name)>0 and count(litTitle)>0 and count(formTitle) >0 and ApprovalStatus='Approved',0,10)) as [Behaviour Score]
Anything obvious i'm doing wrong?
Thanks in advance.!
Hi Daniel,
you are using an aggregation function (count) without a corresponding group by clause It looks like.
Your code as it stands will be loaded row by row, so the count won't work.
Are you looking for a row by row evaluation to create that field? Or do you want to group it up and count?
If you want this row by row and you are just trying to check if the fields contain any value (rather than want a count), the below should work
if ([Behavior Score Criteria] = 'Samples_Form_Lit_Request',if(Len(Material_Name)>0 and Len(litTitle)>0 and Len(formTitle) >0 and ApprovalStatus='Approved',0,10)) as [Behaviour Score]
otherwise look to add a group by
hope that helps
Joe
Hi Daniel,
you are using an aggregation function (count) without a corresponding group by clause It looks like.
Your code as it stands will be loaded row by row, so the count won't work.
Are you looking for a row by row evaluation to create that field? Or do you want to group it up and count?
If you want this row by row and you are just trying to check if the fields contain any value (rather than want a count), the below should work
if ([Behavior Score Criteria] = 'Samples_Form_Lit_Request',if(Len(Material_Name)>0 and Len(litTitle)>0 and Len(formTitle) >0 and ApprovalStatus='Approved',0,10)) as [Behaviour Score]
otherwise look to add a group by
hope that helps
Joe
Hi, try this:
if ([Behavior Score Criteria] = 'Samples_Form_Lit_Request',if(Material_Name)>0 and litTitle>0 and formTitle >0 and ApprovalStatus='Approved',0,10)) as [Behaviour Score],
try to take out the count(field) IN THE EXPRESION IN THE SCRIPT
good luck
Fernando
Thanks JoeSimmons!
I was looking for a row by row evaluation rather than a count, your method worked great.
Thanks very much!
Danny
No worries, glad to help