Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Using same column with different WHERE condition
BIRTing
Hi All,
Actually I have to fetch the values from a column 3 times with 3 different where conditions and they have to be displayed as 3 different fields in report.
Is it possible to use 2 queries in an open method??
Or any suggestions for this case??
Thanks,
Sankar Ganesh
Find more posts tagged with
Comments
mwilliams
Hi Sankar,
Is there a common key between these values that you will be joining them on?
al91206
Can you use the expression builder for each column on the same table to implement if / else statements or a case statement to implement the necessary changes?
I haven't tried that but my associate here is working on just such a report.
BIRTing
Hi Michael,
Thanks!. Actually I am using only one table.. In that there is a column called 'Wonum' i want to fetch count(wonum) in 3 fields with 3 different where condions...
Some one has mentioned , we can use expression builder .. how it can be done .. Can you provide me one example
Thanks,
Sankar Ganesh
mwilliams
Sankar,
So, you have a table, where depending on a field value in it, you want to display 1 of 3 different values from that row from a given dataSet? Is this correct? If so, are they all of the same data type, i.e. integer, string, etc?
BIRTing
Michael,
Thanks a lot for your help!!
They are all of same datatypes only.. because i refer to the same column in database..
And I tried using this Query...
select location,count(wonum) as wocount,wopriority,"
+"(select count(wonum) from workorder where location=w.location and wopriority=w.wopriority "
+" and actstart<=targstartdate) as wocount_response,"
+"(select count(wonum) from workorder where location=w.location "
+" and wopriority=w.wopriority and actfinish<=targcompdate) as wocount_repair from workorder w
Here i am referring count(wonum) 3 times in 3 different where condition..
It fetches some rows... but i am not sure whether its correct or not...
Or is there any better way to do it..
Thanks,
Sankar Ganesh