Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
wendytham
Contributor II
Contributor II

If (Sum()) in load script

Hello,

I want to load the below script but it shows error.

Can someone helps?

LOAD

If (sum(If (IsNull(@22), 0 ,@22))>0, @20, 'Non_used') as Part#,

 

3 Replies
tresesco
MVP
MVP

Do you really need sum() here? If yes, may be you are missing Group By clause with it? If that is not the case, try to share more info on error and script snippet you are using, may be a screen shot.

wendytham
Contributor II
Contributor II
Author

I would like to categorize both of the group as below, but it keep showing error in the script.

If(Sum(@22)>0,Count(DISTINCT @2),0)as PartUsedQty,

If(Sum(@22)=0,Count(DISTINCT @2),0)as NonPartUsedQty,

 

Brett_Bleess
Former Employee
Former Employee

Wendy, the best thing would be if you can attach what you have in the way of an app, or a smaller sample that shows the issue, as it is a bit difficult to try to help when we do not even have the error message being thrown... I am assuming you are just getting 'bad expression' in the expression editor, but not sure...  If you can attach an app, folks can check the data model and everything to try to figure out what is going wrong.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.