You are viewing limited content. For full access, please sign in.

Question

Question

Questions with Topic Laserfiche

asked on December 11, 2013

 I have the SQL query to summarize the following attributes:

 

SELECT [tocid]

,sum(cast([img_size] as bigint)) + sum(cast([txt_size] as bigint)) + sum(cast([loc_size] as bigint)) as totaldocsize

into [Laserfiche_Reporting].[dbo].[BI_totaldoc]

FROM [Laserfiche_ProductionReporting_IntertrustAmsterdam].[dbo].[doc]

group by tocid

 

I added the total to the toc.edoc_size

 

,[Laserfiche_ProductionReporting_IntertrustAmsterdam].[dbo].[toc].[edoc_size] +

[Laserfiche_Reporting].[dbo].[BI_totaldoc].[totaldocsize] as TotalDocumentSize

 

Since the outcome of the followings is so pretty low, I can disregard it:

,isnull(cast(datalength([bitmap]) as bigint), 0) as bitmap
,isnull([attach_size], 0) as attach_size
,isnull(cast(datalength([ann_text]) as bigint), 0) as ann_text           

 With all above in place, I thought I have the sum of the Total Document Size, however some documents is showing the <null> value. 180.000 documents in well over 5.000.000 documents I cannot see what the cause is, anyone an idea?

0 0

Answer

APPROVED ANSWER
replied on December 11, 2013

The queries you provided aren't complete enough to be sure, but could those be documents with no pages?  They won't have rows in your BI_totaldoc table so the NULL produced from an outer join may cause your sums to come out NULL.  You can use isnull to handle that case.

1 0
replied on December 12, 2013

Thanks Brian, that "no pages" was exactly the cause;

- one pdf with Total Document Size, because the text is text searchable

- another pdf with Total Document Size being NULL is because the text is not text searchable and is showing the "This document contains no pages"

0 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.