SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 return data -7 days
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sz1
Constraint Violating Yak Guru

United Kingdom
441 Posts

Posted - 12/17/2012 :  09:16:20  Show Profile  Reply with Quote
Hi

I am trying to return the data from the below expression that is the -7 days from the currentdate.


This returns the correct figure for all resolved calls:
=Sum(IIF(Fields!NUMBER_OF_DAYS.Value < 3,1,0),"DataSet1")/Count(Fields!NUMBER_OF_DAYS.Value, "DataSet1")

Can I use a DataAdd like below to give me -7 days and append to the expression? or do I need to use the resolved date field - 7
And DateAdd("d", -7,now())

SO,
=Sum(IIF(Fields!NUMBER_OF_DAYS.Value < 3,1,0),"DataSet1")And DateAdd("d", -7,now())
/Count(Fields!NUMBER_OF_DAYS.Value, "DataSet1")


Help appreciated.
Thanks

Also tried this to no ovail...

=Sum(IIF(Fields!NUMBER_OF_DAYS.Value < 3,1,0), and DateAdd("d", -7,Today()) ,"DataSet1")
/Count(Fields!NUMBER_OF_DAYS.Value, "DataSet1")

and this although it returns a percentage its very low...

=Sum(IIF(Fields!NUMBER_OF_DAYS.Value < 3,1,0) and Fields!LastWeek.Value ,"DataSet1")
/Count(Fields!NUMBER_OF_DAYS.Value, "DataSet1")


Edited by - sz1 on 12/17/2012 10:01:38

sz1
Constraint Violating Yak Guru

United Kingdom
441 Posts

Posted - 12/17/2012 :  10:14:47  Show Profile  Reply with Quote
I actually need the previous days figure so trying this:

=Sum(IIF(Fields!NUMBER_OF_DAYS.Value < 3,1,0) and Fields!Yesterday.Value,"DataSet1")
/Count(Fields!NUMBER_OF_DAYS.Value, "DataSet1")

The Yesterday field is built in to the DatMart but it does not return anything near correct, can some one advice on the syntax on this on eplease to be able to calculate the above but for the previous day?

Thanks
Go to Top of Page

Matengele
Starting Member

Zambia
4 Posts

Posted - 01/01/2013 :  11:53:04  Show Profile  Reply with Quote
try comparing your dataset date to getdate()-7. Note this should be done in your stored proc if you have one or in the text script that makes up your dataset
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 01/01/2013 :  23:54:28  Show Profile  Reply with Quote
can you explain what percentage you're trying to calculate here? your current expression doesnt make much sense

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.14 seconds. Powered By: Snitz Forums 2000