Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
cpetti04
Contributor
Contributor

Replacing row over partition by function excluding nulls

I am struggling with replacing a sql server row_number over partition by function in qlikview.  I have fortunately replaced the function from help on the forum from another person's post with combination of the previous and peek function however because I am doing this in a load statement from resident table I can't seem to exclude the nulls.  I tried with where clause of load statement however it still counts those row as number 1 just not showing them so seems as if order starts at 2 or 3 depending on number of nulls.  Below is piece of script I am using.  What I need is it to not even look at nulls in the time_arrivedatscene field.  Unfortunately I cannot exclude the nulls in the original SQL as the business units need to know for other reporting requirements when that field is null on an incident.

LEFT JOIN (TestTable)
LOAD
Recno,
if(master_incident_number=previous(master_incident_number),peek("SceneArrivalOrder")+1,1) as "SceneArrivalOrder"
Resident TestTable
Order By master_incident_number, time_arrivedatscene;
DROP Field Recno;

1 Solution

Accepted Solutions
Brett_Bleess
Former Employee
Former Employee

If you can attach your app, or a sample app, I think you are more likely to get some help, this one is a bit tough to get your head wrapped around without it I think.  That way folks can see the data model and the chart expressions and setup...

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.

View solution in original post

1 Reply
Brett_Bleess
Former Employee
Former Employee

If you can attach your app, or a sample app, I think you are more likely to get some help, this one is a bit tough to get your head wrapped around without it I think.  That way folks can see the data model and the chart expressions and setup...

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.