Showing posts with label conditional. Show all posts
Showing posts with label conditional. Show all posts

Wednesday, March 28, 2012

Jump to "No" Report

Hi all,
I'm designing a report that requires a table cell to be able to jump to
another report. This cell needs to be conditional so that if a numeric
value is present, it blocks the ability to jump to another report (and takes
away the link mouse cursor), and if a non numeric value is present (in this
case, a null) it allows jumping to another report.
I can work around by simply having another report page with an error
message, but i'd rather take away the option of making an illegal jump (ie.
the value is numeric) from the end user for ease of use.
eg. Expression in Advanced Properties -> Navigation -> Jump to Report
=IIF(ISNUMERIC(Fields!BaseData.Value), 'No Jump', MyReportName)
Is anyone aware of an phrase/expression i can substitute in for 'No Jump' to
allow this functionality?
Thanks in advance.
JonTry this:
=IIF(ISNUMERIC(Fields!BaseData.Value), Nothing, MyReportName)
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Jonathan Martin" <jonathan.martin@.pcservicecall.co.uk> wrote in message
news:uKcYleHNFHA.3928@.TK2MSFTNGP09.phx.gbl...
> Hi all,
> I'm designing a report that requires a table cell to be able to jump to
> another report. This cell needs to be conditional so that if a numeric
> value is present, it blocks the ability to jump to another report (and
> takes away the link mouse cursor), and if a non numeric value is present
> (in this case, a null) it allows jumping to another report.
> I can work around by simply having another report page with an error
> message, but i'd rather take away the option of making an illegal jump
> (ie. the value is numeric) from the end user for ease of use.
> eg. Expression in Advanced Properties -> Navigation -> Jump to Report
> =IIF(ISNUMERIC(Fields!BaseData.Value), 'No Jump', MyReportName)
> Is anyone aware of an phrase/expression i can substitute in for 'No Jump'
> to allow this functionality?
> Thanks in advance.
>
> Jon
>|||Thanks for getting back to me.
That worked fine with one slight alteration. The final syntax was as
follows. Note the speech marks around the valid jump report's name.
=IIF(ISNUMERIC(Fields!BaseData.Value), Nothing, "MyReportName")
Thanks!
Jon
"Robert Bruckner [MSFT]" <robruc@.online.microsoft.com> wrote in message
news:uv3uiHJNFHA.2132@.TK2MSFTNGP14.phx.gbl...
> Try this:
> =IIF(ISNUMERIC(Fields!BaseData.Value), Nothing, MyReportName)
>
> -- Robert
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
> "Jonathan Martin" <jonathan.martin@.pcservicecall.co.uk> wrote in message
> news:uKcYleHNFHA.3928@.TK2MSFTNGP09.phx.gbl...
>> Hi all,
>> I'm designing a report that requires a table cell to be able to jump to
>> another report. This cell needs to be conditional so that if a numeric
>> value is present, it blocks the ability to jump to another report (and
>> takes away the link mouse cursor), and if a non numeric value is present
>> (in this case, a null) it allows jumping to another report.
>> I can work around by simply having another report page with an error
>> message, but i'd rather take away the option of making an illegal jump
>> (ie. the value is numeric) from the end user for ease of use.
>> eg. Expression in Advanced Properties -> Navigation -> Jump to Report
>> =IIF(ISNUMERIC(Fields!BaseData.Value), 'No Jump', MyReportName)
>> Is anyone aware of an phrase/expression i can substitute in for 'No Jump'
>> to allow this functionality?
>> Thanks in advance.
>>
>> Jon
>>
>

Monday, March 12, 2012

Joining and Conditional Column Data Help

I have 2 table that I want to join and output a row on a condition that one of the records have a null in the field. Heres what I have.

employee table (empid, name)
tasks table (taskid, empid, taskname, resolution)

If the resolution is null than I want it to be accounted for in each employee record. Heres my query so far that joins the 2 tables and accounts for each employee and counts each task they have. I need another column that counts the tasks.resolution's null values for each employee but cant figure it out. Thanks for any help!

SELECT e.empid,
e.name,
COUNT(t.ID) as 'tcount'
FROM tasks t
RIGHT JOIN employee e ON c.empid = t.empid
GROUP BY e.empid, e.name
order by 'tcount' desc

SELECT

e.empid,

e

.empname,

COUNT

(t.taskid)as'tcount'

FROM

tasks t

LEFT

JOIN employee eON e.empid= t.empid

WHERE

t.resolutionISNULL

GROUP

BY e.empid, e.empname

Order

by tcountDesc|||

limno's query doesn't quite work the way you'd expect. Because it is being filtered by where the resolution is null from within the WHERE clause, it will eliminate employees that have no records where resolution is null from the output. If you want the employees listed even if they have no tasks, then use this instead:

SELECT empid, empname, (SELECTCOUNT(*)FROM tasksWHERE tasks.empid=employee.empidAND resolutionISNULL)as'tcount'FROM employeeOrder by tcountDesc

|||

Thanks. That helped me put together someting else

selecte.empid, e.ename, count(*) as 'tcount', sum(case when t.resolution isnull and t.empid is not null then 1 else 0 end) as 'NULL resolution'
from employee as e
left join tasks as t on t.empid = e.empid
group by e.empid, e.ename
order by 3 desc