Friends, Technology, Web2.0 - What I am reading

    [Home] [Recent] [Site Map]

   

Thursday, July 10, 2008

7/10/2008 3:14:29 AM RS Tips 101 - 关于使用Sum函数会遇到的问题(1) >> joycode

用过Reporting service (后面都用RS代替)的人对sum这个函数都不会陌生,这个函数的使用率极高并且非常好用,下面我们就来谈谈使用这个函数可能会遇到的一个问题。

我们先假设报表使用的dataset传过来的数据如下

Supplier      Revenue

A                   0.00

B                   0.00

报表的需求是要算出每个Supplier的Revenue所占的比率。我们在报表中新建一个table,table中新建一个group,group绑定的值为Fields!SupplierName.Value,group的名字为SupplierGroup,该Dataset的名字为Dssup。报表如下:

clip_image002

可以看到比率的计算公式为:

=FormatPercent(Sum(Fields!Revenue.Value,"SupplierGroup")/Sum(Fields!Revenue.Value,"Dssup"),2)

但事实上,由这个计算公式得到的值却是这样:

clip_image004

这个很好理解,是因为我们的计算公式的分母为0,所以出现了NaN这种值,这个时候,按照正常的逻辑,我们都会选择先判断一下分母,改后的计算公式是这样(为了便于查看,先去掉函数FormatPercent):

iif(Sum(Fields!Revenue.Value,"Dssup") = 0, 0.00%, Sum(Fields!Revenue.Value,"SupplierGroup")/Sum(Fields!Revenue.Value,"Dssup"))

 

这个是说如果分母为0,那么传回0.00%,反之通过公式计算。从这个公式来看,没有问题,但是不幸的是,结果依然是NaN。

那么怎么办呢,继续尝试下去,改计算公式为

iif(Sum(Fields!Revenue.Value,"SupplierGroup")/Sum(Fields!Revenue.Value,"Dssup")=’NaN’, 0.00%, Sum(Fields!Revenue.Value,"SupplierGroup")/Sum(Fields!Revenue.Value,"Dssup"))

 

结果证明,改成这样,还是不行。

这个时候,考虑到当Sum(Fields!Revenue.Value,"Dssup") = 0 时,Sum(Fields!Revenue.Value,"SupplierGroup")一定也为0,所以改计算公式为:

Sum(Fields!Revenue.Value,"SupplierGroup")/iif(Sum(Fields!Revenue.Value,"Dssup")=0,1,Sum(Fields!Revenue.Value,"Dssup"))

既如果分母为0,那么强制将分母变为1,最后结果为

clip_image006

这是我们想要的结果。最终计算公式是:

=FormatPercent(Sum(Fields!Revenue.Value,"SupplierGroup")/iif(Sum(Fields!Revenue.Value,"Dssup")=0,1,Sum(Fields!Revenue.Value,"Dssup")),2)

7/10/2008 9:46:35 AM IMAG0199.jpg >> 【刻录事】

恺弘 posted a photo:

IMAG0199.jpg

Cameraphone image posted by Dashwire

7/10/2008 10:34:23 AM IMAG0195.jpg >> 【刻录事】

恺弘 posted a photo:

IMAG0195.jpg

Cellphone image uploaded from Dashwire

7/10/2008 3:00:27 AM Google Lively FAQ >> Google Blogoscoped

Here"s a list of questions with tips and tricks for Google"s 3D chat world, Lively. If you have a question that"s not answered here please ask in the comments, and if you have a tip, please post it too (this page will be updated as new information comes in). What"s Google Lively? Lively (apparently code named Fiji and Google Rooms, and previously nicknamed Google Metaverse by some outside Google) is a three-dimensional chat world by Google. You navigate your avatar to talk to others, show your emotions, and, if you want to, build your own rooms for your website. Lively runs inside the browser but needs a Windows installation first to w ...

7/10/2008 3:16:24 PM Google News Redesign Experiment >> Google Blogoscoped

Ionut of the Google Operating System blog has screenshots of a Google News design experiment, apparently showing to a portion of users (I can"t see it, can you?). On the frontpage (of at least the science/ tech section), there are now a couple of more visual modules, like a "featured photo" section. Ionut argues this marks the first time "when Google News promotes stories just because it has the permission to show associated images" (Google licenses content from some news agencies, and preferring partners over non-partners may be a bit portal style, for better or worse). [Image by Ionut via Santosh with

7/10/2008 3:36:28 PM Swastika Symbol in Google Trends >> Google Blogoscoped

Odd. Google Trends" "Hot Trends" feature, an aggregated overview of recently popular search queries, shows a swastika today in one of the top spots. A swastika has been used as a symbol for different purposes in the past, like in Hinduism and Buddhism, but it was also used by the Nazi party. Could this possibly be some kind of defacement group-effort (or scripting), trying to sneak a Unicode character into Google trends? After all, Google can be searched for symbols like Yin-Yang, the swastika and so on (though one would figure Google Trends uses a large enough s ...

7/10/2008 2:00:25 PM Yahoo Patents Anchor Text Relevance in Search Indexing >> seobythesea

Yahoo was granted a patent this week which describes how anchor text in links may be used to increase the relevancy ranking of a page pointed to by that anchor text. The patent was originally filed in 2002, and it discusses how anchor text might work while naming the Altavista search engine as a [...]

7/10/2008 12:29:10 AM SEO Headlines >> Bruce Clay, Inc. Blog

Google"s New Keyword Research Tool Our PPC guru Nick Guastella was all aflutter this morning over the news that Google has added search counts to its keyword research tool, thereby turning on another light for SEOs and search marketers. According to Google: When you use the Keyword Tool to search...

7/10/2008 11:51:58 PM SEO Training at SMX East by Bruce Clay, Inc. >> Bruce Clay, Inc. Blog

I mentioned earlier this week that there was a lot of great and exciting stuff happening at Bruce Clay, Inc. [And that we"re hiring. --Susan] I also mentioned that there were two more things I wanted to share but would hold off. I"m going to reveal one more item today...


^==Back Home

<==7/9/2008

==> 7/11/2008

Month Archives:

Top Tags:
Google Internet Technology Company & Product Profiles Search feature Business and Technology column Web2.0 analysis 服务介绍 comment application letter 业界信息 news China2.0 Startups deal 產業策進 未來趨勢 Search Headlines 創投 业界动态 創業案例 Social Network Google/SEO widget news_in


@2007 All rights Reserved