Counting columns based on set criteria?
Hello gurus,
I've been trying for the past hour to count the number of columns that have a certain condition met, that is two check boxes are ticked.
For example:
I want to count the number of columns where both Apples & Oranges is TRUE.
I've tried combinations of SUMIF, COUNTIF, IF, & COLUMNS and really don't have a clue. Searching the web for Excel examples doesn't help and I can't find anything like this on this forum.
Any help would be much appreciated.
Regards,
Dr Paul Martin
The closest I've been is this:
=COUNT(AND(Table :: Apples,Table :: Oranges))
The AND function only generates one result (TRUE/FALSE) which I convert to a number (1/0) with the COUNT function.
The problem is that I can't count a range of columns that meet this criteria.... it will only give me one result not the total number of positive results.
What I need is something like this:
=COLUMNS(AND(Table :: Apples,Table :: Oranges))
Except that generates an error "COLUMNS requires a range but found a boolean instead". I guess I can't mix them up?
Regards,
Dr Paul Martin
Message was edited by: nitramluap
Similar Messages
-
Analytic function to count rows based on Special criteria
Hi
I have the following query with analytic function but wrong results on the last column COUNT.
Please help me to achive the required result.Need to change the way how I select the last column.
1)I am getting the output order by b.sequence_no column . This is a must.
2)COUNT Column :
I don't want the total count based on thor column hence there is no point in grouping by that column.
The actual requirement to achieve COUNT is:
2a -If in the next row, if either the THOR and LOC combination changes to a new value, then COUNT=1
(In other words, if it is different from the following row)
2b-If the values of THOR and LOC repeats in the following row, then the count should be the total of all those same value rows until the rows become different.
(In this case 2b-WHERE THE ROWS ARE SAME- also I only want to show these same rows only once. This is shown in the "MY REQUIRED OUTPUT) .
My present query:
select r.name REGION ,
p.name PT,
do.name DELOFF,
ro.name ROUTE,
decode(th.thorfare_name,'OSIUNKNOWN',NULL,th.thorfare_name)
THOR,
l.name LOC ,
b.sequence_no SEQ,
CASE WHEN th.thorfare_name = LAG (th.thorfare_name)
OVER (order by b.sequence_no)
or th.thorfare_name = LEAD (th.thorfare_name)
OVER (order by b.sequence_no)
THEN COUNT(b.sequence_no) OVER (partition by r.name,th.thorfare_name,l.name order BY b.sequence_no
ELSE 1
END COUNT
from t_regions r,t_post_towns p,t_delivery_offices do, t_routes ro, t_counties c,t_head_offices ho,
t_buildings b,t_thoroughfares th,t_localities l
where th.thorfare_id = b.thorfare_id
and nvl(b.invalid,'N')='N'
and b.route_id=ro.route_id(+)
and b.locality_id =l.locality_id(+)
and ro.delivery_office_id=do.delivery_office_id(+)
and do.post_town_id = p.post_town_id(+)
and p.ho_id=ho.ho_id(+)
and ho.county_id = c.county_id(+)
and c.region_id = r.region_id(+)
and r.name='NAAS'
and do.DELIVERY_OFFICE_id= &&DELIVERY_OFFICE_id
and ro.route_id=3405
group by r.name,p.name,do.name,ro.name,th.thorfare_name,l.name,b.sequence_no
ORDER BY ro.name,b.sequence_no;My incorrect output[PART OF DATA]:
>
REGION PT DELOFF ROUTE THOR LOC SEQ COUNT
NAAS NAAS MAYNOOTH MAYNOOTHR010 DUBLINRD CEL 1 1
NAAS NAAS MAYNOOTH MAYNOOTHR010 NEWTOWNRD CEL 2 1
NAAS NAAS MAYNOOTH MAYNOOTHR010 PRIMHILL CEL 4 1
NAAS NAAS MAYNOOTH MAYNOOTHR010 NEWTOWNRD CEL 5 1
NAAS NAAS MAYNOOTH MAYNOOTHR010 THEGROVE CEL 2 1
NAAS NAAS MAYNOOTH MAYNOOTHR010 NEWTOWNRD CEL 7 3
NAAS NAAS MAYNOOTH MAYNOOTHR010 NEWTOWNRD CEL 8 4
NAAS NAAS MAYNOOTH MAYNOOTHR010 NEWTOWNRD CEL 9 5
NAAS NAAS MAYNOOTH MAYNOOTHR010 NEWTOWNRD CEL 10 6
NAAS NAAS MAYNOOTH MAYNOOTHR010 NEWTOWNRD CEL 11 7
NAAS NAAS MAYNOOTH MAYNOOTHR010 NEWTOWNRD CEL 12 8
NAAS NAAS MAYNOOTH MAYNOOTHR010 DUBLINRD CEL 15 2
NAAS NAAS MAYNOOTH MAYNOOTHR010 DUBLINRD CEL 19 3
NAAS NAAS MAYNOOTH MAYNOOTHR010 DUBLINRD CEL 24 4
NAAS NAAS MAYNOOTH MAYNOOTHR010 DUBLINRD CEL 29 5
NAAS NAAS MAYNOOTH MAYNOOTHR010 DUBLINRD CEL 34 6
NAAS NAAS MAYNOOTH MAYNOOTHR010 DUBLINRD CEL 39 7
NAAS NAAS MAYNOOTH MAYNOOTHR010 DUBLINRD CEL 42 2
NAAS NAAS MAYNOOTH MAYNOOTHR010 PRIMHILL CEL 43 2
NAAS NAAS MAYNOOTH MAYNOOTHR010 PRIMHILL CEL 44 3
My required output[PART OF DATA]-Please compare with the above.:
>
REGION PT DELOFF ROUTE THOR LOC COUNT
NAAS NAAS MAYNOOTH MAYNOOTHR010 DUBLINRD CEL 1
NAAS NAAS MAYNOOTH MAYNOOTHR010 NEWTOWNRD CEL 1
NAAS NAAS MAYNOOTH MAYNOOTHR010 PRIMHILL CEL 1
NAAS NAAS MAYNOOTH MAYNOOTHR010 NEWTOWNRD CEL 1
NAAS NAAS MAYNOOTH MAYNOOTHR010 THEGROVE CEL 1
NAAS NAAS MAYNOOTH MAYNOOTHR010 NEWTOWNRD CEL 6
NAAS NAAS MAYNOOTH MAYNOOTHR010 DUBLINRD CEL 7
NAAS NAAS MAYNOOTH MAYNOOTHR010 PRIMHILL CEL 2
NOTE :Count as 1 is correctly coming.
But where there is same rows and I want to take the total count on them, I am not getting.
Pls pls help.
Thanks
Edited by: Krithi on 04-Nov-2010 05:28Nicosa wrote:
Hi,
Can you give us some sample data (create table + inserts orders) to play with ?
Considering your output, I'm not even sure you need analytic count.Yes sure.
I am describing the query again here with 3 tables now to make this understand better.
Given below are the create table statements and insert statements for these 3 tables.
These tables are - BULDINGSV,THORV and LOCV
CREATE TABLE BUILDINGSV
BUILDING_ID NUMBER(10) NOT NULL,
INVALID VARCHAR2(1 BYTE),
ROUTE_ID NUMBER(10),
LOCALITY_ID NUMBER(10),
SEQUENCE_NO NUMBER(4),
THORFARE_ID NUMBER(10) NOT NULL
CREATE TABLE THORV
THORFARE_ID NUMBER(10) NOT NULL,
THORFARE_NAME VARCHAR2(40 BYTE) NOT NULL
CREATE TABLE LOCV
LOCALITY_ID NUMBER(10) NOT NULL,
NAME VARCHAR2(40 BYTE) NOT NULL);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(59002372, 'N', 3405, 37382613, 5, 9002375);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(59002363, 'N', 3405, 37382613, 57, 9002364);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(59002362, 'N', 3405, 37382613, 56, 9002364);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(59002360, 'N', 3405, 37382613, 52, 9002364);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(59002358, 'N', 3405, 37382613, 1, 9002364);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(59002240, 'N', 3405, 37382613, 6, 9002284);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(59002229, 'N', 3405, 37382613, 66, 35291883);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(59002228, 'N', 3405, 37382613, 65, 35291872);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(59002226, 'N', 3405, 37382613, 62, 35291883);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(59002222, 'N', 3405, 37382613, 43, 35291883);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(59002217, 'N', 3405, 37382613, 125, 35291883);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(59002221, 'N', 3405, 37382613, 58, 9002364);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(59002214, 'N', 3405, 37382613, 128, 35291883);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(33363182, 'N', 3405, 37382613, 114, 35291883);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(33363185, 'N', 3405, 37382613, 115, 35291883);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(59002371, 'N', 3405, 37382613, 2, 9002375);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(27003329, 'N', 3405, 37382613, 415, 9002375);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(59002359, 'N', 3405, 37382613, 15, 9002364);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(59002224, 'N', 3405, 37382613, 61, 35291883);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(27003318, 'N', 3405, 37382613, 411, 9002375);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(27003326, 'N', 3405, 37382613, 412, 9002375);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(27003327, 'N', 3405, 37382613, 413, 9002375);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(27003328, 'N', 3405, 37382613, 414, 9002375);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(27003330, 'N', 3405, 37382613, 416, 9002375);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(27003331, 'N', 3405, 37382613, 417, 9002375);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(27003332, 'N', 3405, 37382613, 410, 9002375);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(27004795, 'N', 3405, 37382613, 514, 9002375);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(27004807, 'N', 3405, 37382613, 515, 9002375);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(59002227, 'N', 3405, 37382613, 64, 35291872);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(33230805, 'N', 3405, 37382613, 44, 35291883);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(33231027, 'N', 3405, 37382613, 7, 9002375);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(33231058, 'N', 3405, 37382613, 9, 9002375);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(33231078, 'N', 3405, 37382613, 10, 9002375);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(33231087, 'N', 3405, 37382613, 11, 9002375);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(33231093, 'N', 3405, 37382613, 12, 9002375);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(33229890, 'N', 3405, 37382613, 55, 9002364);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80561996, 'N', 3405, 34224751, 544, 35417360);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80561997, 'N', 3405, 34224751, 543, 35417360);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80561998, 'N', 3405, 34224751, 555, 35417360);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80562000, 'N', 3405, 34224751, 541, 35417360);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80562001, 'N', 3405, 34224751, 538, 35417360);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80562028, 'N', 3405, 35417256, 525, 0);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80562031, 'N', 3405, 35417256, 518, 35417271);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80562032, 'N', 3405, 35417256, 519, 35417271);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80562033, 'N', 3405, 35417256, 523, 35417271);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80561939, 'N', 3405, 34224751, 551, 35417360);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80561940, 'N', 3405, 34224751, 552, 35417360);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80561941, 'N', 3405, 34224751, 553, 35417360);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80561942, 'N', 3405, 35417256, 536, 0);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80561943, 'N', 3405, 35417256, 537, 0);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80561970, 'N', 3405, 35417256, 522, 35417271);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80561972, 'N', 3405, 35417256, 527, 35417271);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80561974, 'N', 3405, 35417256, 530, 35417271);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80561975, 'N', 3405, 35417256, 531, 35417271);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80561980, 'N', 3405, 34224751, 575, 35417360);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80561981, 'N', 3405, 34224751, 574, 35417360);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80561983, 'N', 3405, 34224751, 571, 35417360);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80561984, 'N', 3405, 34224751, 570, 35417360);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80561985, 'N', 3405, 34224751, 568, 35417360);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80561986, 'N', 3405, 34224751, 567, 35417360);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80561987, 'N', 3405, 34224751, 566, 35417360);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80561989, 'N', 3405, 34224751, 563, 35417360);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80561990, 'N', 3405, 34224751, 562, 35417360);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80561991, 'N', 3405, 34224751, 560, 35417360);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80561992, 'N', 3405, 34224751, 559, 35417360);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80561993, 'N', 3405, 34224751, 558, 35417360);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80561994, 'N', 3405, 34224751, 548, 35417360);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80561995, 'N', 3405, 34224751, 546, 35417360);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80562160, 'N', 3405, 37382613, 139, 35291878);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80562161, 'N', 3405, 37382613, 140, 35291878);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80562162, 'N', 3405, 37382613, 141, 35291878);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80562163, 'N', 3405, 37382613, 142, 35291878);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80562164, 'N', 3405, 37382613, 143, 35291878);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80562165, 'N', 3405, 37382613, 145, 35291878);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80562166, 'N', 3405, 37382613, 100, 35291883);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80562167, 'N', 3405, 37382613, 102, 35291883);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80562171, 'N', 3405, 37382613, 107, 35291883);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80562172, 'N', 3405, 37382613, 108, 35291883);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80562174, 'N', 3405, 37382613, 110, 35291883);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80562175, 'N', 3405, 37382613, 111, 35291883);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80562176, 'N', 3405, 37382613, 112, 35291883);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80562177, 'N', 3405, 37382613, 113, 35291883);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80562182, 'N', 3405, 37382613, 123, 35291883);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80562183, 'N', 3405, 37382613, 121, 35291883);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80562184, 'N', 3405, 37382613, 120, 35291883);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80562185, 'N', 3405, 37382613, 118, 35291883);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80562186, 'N', 3405, 37382613, 117, 35291883);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80562187, 'N', 3405, 37382613, 116, 35291883);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80562189, 'N', 3405, 37382613, 95, 35291883);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80562190, 'N', 3405, 37382613, 94, 35291883);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80562213, 'N', 3405, 37382613, 89, 35291872);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(80562240, 'N', 3405, 35417256, 516, 35417271);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(35329559, 'N', 3405, 35329152, 443, 35329551);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(35329560, 'N', 3405, 35329152, 444, 35329551);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(35329562, 'N', 3405, 35329152, 446, 35329551);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(35329109, 'N', 3405, 35329152, 433, 35329181);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(35329169, 'N', 3405, 35329152, 434, 35329181);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(35329557, 'N', 3405, 35329152, 441, 35329551);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(35329558, 'N', 3405, 35329152, 442, 35329551);
Insert into BUILDINGSV
(BUILDING_ID, INVALID, ROUTE_ID, LOCALITY_ID, SEQUENCE_NO, THORFARE_ID)
Values
(35329191, 'N', 3405, 35329152, 436, 35329181);
COMMIT;
Insert into THORV
(THORFARE_ID, THORFARE_NAME)
Values
(0, 'OSIUNKNOWN');
Insert into THORV
(THORFARE_ID, THORFARE_NAME)
Values
(9002284, 'THE GROVE');
Insert into THORV
(THORFARE_ID, THORFARE_NAME)
Values
(9002364, 'DUBLIN ROAD');
Insert into THORV
(THORFARE_ID, THORFARE_NAME)
Values
(9002375, 'NEWTOWN ROAD');
Insert into THORV
(THORFARE_ID, THORFARE_NAME)
Values
(35291872, 'HAZELHATCH ROAD');
Insert into THORV
(THORFARE_ID, THORFARE_NAME)
Values
(35291878, 'SIMMONSTOWN PARK');
Insert into THORV
(THORFARE_ID, THORFARE_NAME)
Values
(35291883, 'PRIMROSE HILL');
Insert into THORV
(THORFARE_ID, THORFARE_NAME)
Values
(35329181, 'THE COPSE');
Insert into THORV
(THORFARE_ID, THORFARE_NAME)
Values
(35329213, 'THE COURT');
Insert into THORV
(THORFARE_ID, THORFARE_NAME)
Values
(35329529, 'THE CRESCENT');
Insert into THORV
(THORFARE_ID, THORFARE_NAME)
Values
(35329551, 'THE LAWNS');
Insert into THORV
(THORFARE_ID, THORFARE_NAME)
Values
(35329580, 'THE DRIVE');
Insert into THORV
(THORFARE_ID, THORFARE_NAME)
Values
(35417271, 'TEMPLEMILLS COTTAGES');
Insert into THORV
(THORFARE_ID, THORFARE_NAME)
Values
(35417360, 'CHELMSFORD');
Insert into THORV
(THORFARE_ID, THORFARE_NAME)
Values
(36500023, 'THE CLOSE');
Insert into THORV
(THORFARE_ID, THORFARE_NAME)
Values
(36500101, 'THE GREEN');
Insert into THORV
(THORFARE_ID, THORFARE_NAME)
Values
(37375569, 'THE DOWNS');
Insert into THORV
(THORFARE_ID, THORFARE_NAME)
Values
(37375595, 'THE PARK');
Insert into THORV
(THORFARE_ID, THORFARE_NAME)
Values
(37375754, 'THE AVENUE');
Insert into THORV
(THORFARE_ID, THORFARE_NAME)
Values
(37375781, 'THE VIEW');
Insert into THORV
(THORFARE_ID, THORFARE_NAME)
Values
(37376046, 'THE CRESCENT');
Insert into THORV
(THORFARE_ID, THORFARE_NAME)
Values
(37376048, 'THE GLADE');
COMMIT;
Insert into LOCV
(LOCALITY_ID, NAME)
Values
(34224751, 'SIMMONSTOWN');
Insert into LOCV
(LOCALITY_ID, NAME)
Values
(35417256, 'TEMPLEMILLS');
Insert into LOCV
(LOCALITY_ID, NAME)
Values
(35329152, 'TEMPLE MANOR');
Insert into LOCV
(LOCALITY_ID, NAME)
Values
(37382613, 'CELBRIDGE');
Insert into LOCV
(LOCALITY_ID, NAME)
Values
(37375570, 'SAINT WOLSTAN''S ABBEY');
COMMIT;
------------------------------------------------------------------------------Now the query with wrong result:
select decode(th.thorfare_name,'OSIUNKNOWN',NULL,th.thorfare_name)
THOR,
l.name LOC,
b.sequence_no SEQ,
CASE WHEN th.thorfare_name = LAG (th.thorfare_name)
OVER (order by b.sequence_no)
or th.thorfare_name = LEAD (th.thorfare_name)
OVER (order by b.sequence_no)
THEN COUNT(b.sequence_no) OVER (partition by th.thorfare_name,l.name order BY b.sequence_no
ELSE 1
END COUNT from BUILDINGSV b,THORV th,LOCV l
where th.thorfare_id = b.thorfare_id
and nvl(b.invalid,'N')='N'
and b.route_id=3405
and b.locality_id =l.locality_id(+)
order by b.sequence_no;The query result -WRONG (only first few lines)
THOR LOC SEQ COUNT
DUBLIN ROAD CELBRIDGE 1 1
NEWTOWN ROAD CELBRIDGE 2 1
NEWTOWN ROAD CELBRIDGE 5 2
THE GROVE CELBRIDGE 6 1
NEWTOWN ROAD CELBRIDGE 7 3
NEWTOWN ROAD CELBRIDGE 9 4
NEWTOWN ROAD CELBRIDGE 10 5
NEWTOWN ROAD CELBRIDGE 11 6
NEWTOWN ROAD CELBRIDGE 12 7
DUBLIN ROAD CELBRIDGE 15 1
PRIMROSE HILL CELBRIDGE 43 1
PRIMROSE HILL CELBRIDGE 44 2
DUBLIN ROAD CELBRIDGE 52 3
DUBLIN ROAD CELBRIDGE 55 4
DUBLIN ROAD CELBRIDGE 56 5
DUBLIN ROAD CELBRIDGE 57 6
DUBLIN ROAD CELBRIDGE 58 7
PRIMROSE HILL CELBRIDGE 61 3
PRIMROSE HILL CELBRIDGE 62 4
HAZELHATCH ROAD CELBRIDGE 64 1
HAZELHATCH ROAD CELBRIDGE 65 2The query result -EXPECTED (only first few lines)
THOR LOC COUNT
DUBLIN ROAD CELBRIDGE 1
NEWTOWN ROAD CELBRIDGE 2
THE GROVE CELBRIDGE 1
NEWTOWN ROAD CELBRIDGE 5
DUBLIN ROAD CELBRIDGE 1
PRIMROSE HILL CELBRIDGE 2
DUBLIN ROAD CELBRIDGE 5
PRIMROSE HILL CELBRIDGE 2
HAZELHATCH ROAD CELBRIDGE 2Please note, in the expected result, I only need 1 row but need to show the total count of rows until the names change.
So the issues are
1) the count column values are wrong in my query.
2)I dont want to repeat the same rows(Please see EXPECTED output and compare it against the original)
3)Want the output in exactly same way as in EXPECTED OUTPUT as I dont want to group by thor name(Eg. I dont want the count for all DUBLIN ROAD but I want to examine rows for the next one, if THOR/LOC combination is different in next row then COUNT=1 else COUNT=Count of no. of rows for that thor/loc combination until the combination change -So there are same value multiple rows which i need to show it in 1 row with the total count)
I am explaining below this in more detail!!
I only need 1 row per same THOR/LOC names coming multiple times but I need the count shown against that 1 row(i.e COUNT= how many rows with same thor/loc combination until THOR/LOC combo changes value).
Then repeat the process until all rows are finished..
If there is no multiple row with same THOR/LOC coming in the following row-i.e the following row is a different THOR/LOC combination, then the count for that row is 1.
Hope this is clear.
Is this doable?
Thanks in advance.
Edited by: Krithi on 04-Nov-2010 07:45
Edited by: Krithi on 04-Nov-2010 07:45
Edited by: Krithi on 04-Nov-2010 08:31 -
How do you lookup multiple values in different columns based on variable criteria?
Essentially, I'd like to be able to do a Vlookup but instead of searching for one value only, search for multiple values in separate columns. A smaller version of my current spreadsheet as an example...
Attack Type ->
Fire
Water
Grass
Fire
1/2x
2x
1/2x
Water
1/2x
1/2x
2x
Grass
2x
1/2x
1/2x
Fire/Water
1/4x
1x
1x
Fire/Grass
1x
1x
1/4x
Grass/Water
1x
1/4x
1x
The headers are the attack types and the list of types to the left are the receiving Pokemon. Fire does half damage (1/2x) to fire types, Water does double damage (2x) to fire types, etc. I'd like to be able to search for specific damages for each type. For example, I'd like to find a Typing that recieves half (1/2x) damage from Fire-type attacks but also recieves double (2x) from Grass-type attacks. I do want more than just two search criteria though seeing as the actual table is much, much larger.
I've tried assigning number values to each damage multiplier and then merging all of them together for a specific typing and doing a VLOOKUP based on checkboxes determining what damage multiplier I want in a few specific types, the rest being filled in to the standard of 1x but the result isn't correct most of the time.Hi Mitchell,
VLOOKUP can be set for accept either an 'exact match' or a 'close match'. Your 17 digit 'number' is actually a 17 character text string (Numbers can handle numbers to a precision of only 15 places). Provided all 17 digits are present, sorting should be the same as for numerical values—the leftmost character is the most significant.
As a text string, your 'number' is sorted/evaluated alphabetically. A 'close match' accepts the 'largest value that is less than or equal to the search value'.
If your search term is 000200000 (a 9 character string), several 'wrong' answers will fit the 'close match' criteria, including all of those listed below:
000200000 (the 'correct' match)
0000xxxxx (x may be any of the three acceptable values)
0001xxxxx (x may be any of the three acceptable values)
The main problem here is that digits in a number (or characters in a text string) have decreasing significance related to their distance from the beginning of the string/number. You want a search in which each character has the same significance as each of the others when compared to the search key. To do that, you need to compare each character in the search string with the character in the same position in the similar string for each type of Pokemon, then take a count of the matches or a sum of the differences.
Here's one approach:
Column A contains labels.
Column B, the 17 digit search term, created in whatever manner you wish, and the similar 17 digit string for each of the characters.
Columns C through S contains a formula that detines, using subtraction, the difference between each digit of the search term and the corresponding digit of each character's profile.
Column C uses SUM() to calculate the total of columns C to S for each row.
T1 uses =MIN(T) to calculate "least different" profile.
Column A is a Header column; Row 1 is a Header row.
Formulas:
C2, and filled right to S2, then down to the last row of data:
=ABS(MID($B$1,COLUMN()-2,1)-MID($B2,COLUMN()-2,1))
T1: =MIN(T)
T2, and filled down column T: =SUM(C2:S2)
The conditional formatting rule set for all body cells in column T is shown below the table.
This may be enough to get you started. Formulas can be tweaked to produce results more closely matching what you're looking for, if necessary.
Regards,
Barry -
ALV - Automatic Adjustable Columns (based on selection criteria)
Hi,
I am currently in the process of building a costing report for a number of materials.
For the output, the columns will be the months, while the rows will pertain to the specific materials (1 or 2 columns for the material text and info).
For example, the columns of the report will look something like:
Material January February March u2026.. December
In the selection-screen, I will have input fields, including posting period range (month) and fiscal year single value.
If the user enters year 2008 and period 10, I only want 1 column for October, with the other columns not present
If they enter year 2008 and period 10 to 11, then only columns October and November show be displayed.
Is this possible in abap ALV programming? If so, how? Are there FMu2019s and object-oriented routes that I can take & if so, what do I do? Please provide code samples if possible.
Please help.
Thanks,
JohnI think you can accomplish this using dynamic internal tables...
one another alternative is to have rows of months and columns as data... ie
jan data1 data2....
feb
mar -
Select a column based on a criteria
Hi!
I am working on a marketing dw. The customers table have information about the address of customers. There are two type of addresses- home and mailing. A customer can have both or one of the type of address. In a demographic report I have to find the number of customers by state and city. The requirement is to create a report based on home address, if home address is not available we can use mailing address.I tried CASE function with no results. How can I get this logic to work?
Thanks,
-DHi!
I am working on a marketing dw. The customers table have information about the address of customers. There are two type of addresses- home and mailing. A customer can have both or one of the type of address. In a demographic report I have to find the number of customers by state and city. The requirement is to create a report based on home address, if home address is not available we can use mailing address.I tried CASE function with no results. How can I get this logic to work?
Thanks,
-D -
Count Metric based on two physical columns
I have a fact table that has Beginning Inventory On Hand (BOH) Units and Ending Inventory On Hand (EOH) Units.
It also contains sales dollars and sales units and other facts. My dimensions are: Locations, Time, Products.
Locations
All Stores
Region
District
Store
Products
All Products
Division
Entity
Subdivision
SubClass
Time
Week
We have fact tables at the lowest level and we have aggregrate tables at certain points.
We are trying to create some count metrics in the BMM Layer. We have created a metric that will count the number
of stores that have Sales Units at each level of the product dimension. We did this by mapping the logical column
to the physical column of Sales Units. We then defined the aggregation for this metric based on dimensions. The
first thing we needed to do is Sum the Sales Units across Products, so we set the "Other" as a sum. We then need
to apply the Count Distinct, so we set this at the Location Dimension.
Based On Dimensions
Sum(Sales Units) - Other Dimensions
Count (Distinct Case When Sales Units > 0 then store number else null end ) - Location Dimension
This will give a final rule as follows:
Count (Distinct Case When SUM(Sales Units) > 0 then store number else null end )
This is working great. However, we now want to create a logical metric that will count the number of stores based on the evaluation of two physical columns.
Count the number of stores that have Sales Units > 0 OR EOH Units > 0.
I do not know how to evaluate two physical columns and apply a count against them.
Thanks in advance for your help.create same column for sum(eoh)
Count (Distinct Case When SUM(Sales Units) > 0 then store number
else
case when SUM(eoh) > 0 then store number else null end
else null end ) -
How to set Tile count column or count row?
How to set Tile count column or count row? If not can do, How
to adjust count row or count column?
Thx for all idea.The Tile container's number of columns and rows is calculated
based on each child's width and height (or based on tileWidth and
tileHeight which you can set). If you need more control over the
layout, use Grid. -
Level Based Measure and a column based on that
Hello All,
I need suggestions to implement the following requirement.
1. No of orders stored in a fact table at day level
2. No. of orders at month level should be calculated
3. Depending on the count, each month would be assigned to a bucket.
0-10 orders -> B1
11-100 orders -> B2
> 100 orders -> B3
What I did in RPD
1. fact joined to time dimension
2. created a logical column: ORDER_COUNT: count(distinct order_number) iand set the level = month
3. created a logical column: BUCKET: using the output of above logical column and CASE statement to implement the bucket rule.
Now, when I run a report like this:
Year; ORDER_COUNT; BUCKET
Returns me 12 rows. Understood because ORDER_COUNT is a month level measure
E.g.
2011 5 B1
2011 5 B1
2011 15 B2
2011 15 B2
2011 5 B1
2011 5 B1
2011 15 B2
2011 15 B2
2011 5 B1
2011 5 B1
2011 15 B2
2011 15 B2
But as soon as I pull the BUCKET column as column heading in pivot table, it returns me only the 1st month row and changes the "BUCKET" value to B3.
Looks like, it recalculates the bucket and sums up all 12 months orders and then applies the bucket rule.
Like this -
B3
2011 5
My expectation was something like this
B1 B2 B3
2011 30 90 0
where 30 is the sum of the order_counts of all B1 months, <m>
Ques:
1. Is there a way I can avoid the recalculation of bucket information when the granularity/dimensionality changes in the report
2. I read in the below link that if the grain of the report > grain of the level-based-measure then the output of the report is "not-deterministic"
Am I hitting that scenario?
[http://gerardnico.com/wiki/dat/obiee/measure_level_based]
Any suggestion would be highly appreciated.
I am using 11.1.1.6.2 version.
Thanks & Regards
MonikaHi ,
If I understand your requirement correctly , then you need currency Conversion.
you can refer this links.
http://consultingblogs.emc.com/christianwade/archive/2006/08/24/Currency-Conversion-in-Analysis-Services-2005.aspx
http://www.ssas-info.com/analysis-services-faq/27-mdx/244-how-change-currency-symbol-based-on-selected-currency-dimension-member
http://social.technet.microsoft.com/wiki/contents/articles/18672.currency-conversion-in-ssas-2012-multidimensional-tabular.aspx
May I know , You Require all this using MDX and SSRS Parameter ?
Thanks -
Report with multiple COUNT columns with counts from same table
I am new to discoverer so I am a bit lost.
I am working to create a report to show usage data from the eBusiness Knowledge Base. I have the query written in SQL using subqueries that is in the format:
Solution Number | Soultion Title | Solution Views | Positive Feedback | Negative Feedback
12345 ___________ Title ________ 345 ____________ 98 _______________ 34
The 'Views', 'Positive' and 'Negative' entries are stored in the same table so i am doing a count where setid=setid and usedtype=VS, then counting where usedtype=PF and usedtype=NF
In discoverer I can get the solution number, title and ONE of the totals but I can't seem to figure out how to get a COUNT for three different things from the same table in columns on the same row.
When I go to edit sheet -> select items once I select the COUNT option for the UsedType column in the table CS_KB_SET_USED_HISTS I can't select it again. I also have found now way to add a column based on an entered query.
If anyone could help it would be much appreciated.
Thanks
Edited by: Toolman21 on Dec 2, 2010 2:17 PM
added ______ to correct spacing.Hi,
You can separate the column by using a case or decode.
for example create 2 calculations:
case
when usedtype='PF'
then <you original column> --- the one contain them both
else 0
end
case
when usedtype='NF'
then <you original column> --- the one contain them both
else 0
end
after that you can create the count aggregation over those.
Tamir -
Hide or show a column based on a parameter?
I have a parameter that has two values linked to 2 fields and included in my SQL query. I would like to hide or show columns based on the parameter value chosen for other fields. How do I begin to write the expression?
Hi KittyCat101,
Based on my understanding, you want to display columns dynamically based on a parameter, right?
In your scenario, you can specify column visibility for all columns based on the expression which contains selected parameter values. So that if we select a value from the drop-down list of the parameter, the column will display based on the column visibility
expression. For more information, please refer to this article:
Conditionally Setting Column Visibility in SSRS.
If you have any question, please feel free to ask.
Best regards,
Qiuyun Yu
Qiuyun Yu
TechNet Community Support -
How to insert into date column based on other columns?
Hi
I have four columns in a table called game named as
R_Day - Type - Number
R_Month - Type - Number
R_Year - Type - Number
R_Date - Type - Date
I have around 1000 records and i want to fill R_Date column based on the data in the R_Day,R_Month,R_Year.
How to write a query to fill the R_Date column based on other three columns.
Thanks
srinivasselect
to_date(R_Day||'-'||R_Month||'-'||R_Year,'DD-MM-YYYY')
dt from (select 23 R_Day,07 R_Month,2007 R_Year from
dual);
Hi,
Update <Table Name> set R_Date=select
to_date(R_Day||'-'||R_Month||'-'||R_Year,'DD-MM-YYYY')
from <Table Name>
Regds.
Nirmal
SQL> select * from test;
R_DAY R_MONTH R_YEAR R_DATE
1 1 2007
21 11 2007
SQL> update test
2 set r_date = select to_date(R_Day||'-'||R_Month||'-'||R_Year,'DD-MM-YYYY')
3 from test;
set r_date = select to_date(R_Day||'-'||R_Month||'-'||R_Year,'DD-MM-YYYY')
ERROR at line 2:
ORA-00936: missing expression
SQL> update test
2 set r_date = to_date(r_day||'-'||r_month||'-'||r_year,'dd-mm-yyyy');
2 rows updated.
SQL> select * from test;
R_DAY R_MONTH R_YEAR R_DATE
1 1 2007 01-JAN-07
21 11 2007 21-NOV-07
NB:Please test before posting.. -
Changing display of item in column based on its value
Hi,
I'm confused as to how I can change the display attributes of an item in a column based on that items value. I've grepped through the forums and it seems there are ways to do this in the report query but that seems inefficient. My preferred method would be at the column level, I could set up some logic that says "if the value is X then display A and if the value is Y then display B". In this case A and B could be a snippet of HTML to display an image that represents the value.
Seems reasonable that this app would have this functionality and I'm sure it's there, I just can't seem to find it.
Help! Suggestions welcome, heckling encouraged!
Thanks,
JonJon,
You should probably start storing the images in a custom table as described here:
http://www.oracle.com/technology/obe/apex/apex31nf/apex31blob.htm
The following column is taken from the Products query in the sample application (page 3):
decode(nvl(dbms_lob.getlength(p.product_image),0),0,null,'<img src="'||apex_util.get_blob_file_src('P6_PRODUCT_IMAGE',p.product_id)||'" height="75" width="75" />') img
Note, getting this configured is a little tricky the first time. Notice that there is an item from page 6 referenced. Page 6 contains that item and a DML process both of which are needed for everything to work. Read more here:
http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10499/advnc.htm#BCGGJHEF
Regards,
Dan
http://danielmcghan.us
http://sourceforge.net/projects/tapigen -
Dispaly or Hide a column based on Prompt Value
Hi All,
How can I Display or Hide a Column based on Prompt Value selected?
On my dashboard I have a Report/Request and a Dashboard Prompt.
Dashboard Prompt has three values, say: *'A', 'B' and 'C'*.
And my report/request has three columns named *'Field1', 'Field2'* and Field3'.
What I am trying to achieve is that whenever user selects prompt values as *'A' or 'B'* all the three fields on my report named *'Field1', 'Field2' and Field3'* should be displayed, however whenever user selects prompt values as *'C'* only fields named *'Field1' and 'Field2'* should be displayed.
Thanks,
DeepakHi Bhavna,
I tried using View Selector, however I am not able to achieve the required functionality with that.
I created a Request with 3 columns in it, then I switched to criteria and added another table to that. The new table automatically got the similar 3 columns used in the first report. Now when I tried to delete one of those columns from the new report, it also got deleted from the first report.
All the views are dependent, changes made to one are reflected in other.
Can't figure it out, where am I going wrong?
Thanks,
Deepak -
How to hide table column based on country molga value
Hi Experts,
I am doing some enhancement in ess application. I want to hide table column based on country code i.e. Molga value.
I want to hide coulm for only Japan country reset of them i need to be show those coulmn.
Could you please provide me a sample code.
Regards
ChakriHi Chakri,
Your setting the table value that time you will get the Country Code.
1.Create the attribute like Country_Column_Visible Data Type bind the com.sap.ide.webdynpro.uielementdefinitions.Visibility this value you need to bind the table country column.
2.In Table You need to check the country code Japan is available you need follow this below sample code.
for(int i=0;i<tablesize;i++)
tablesithValue=wdContext.nodeTable().getTablenode(i);
if(null != tablesithValue.getcountrycode)
if(tablesithValue.getcountrycode.equalsIgnoreCase("Japan"))
wdContext.currentxxxxElement.setCountry_Column_Visible(WDVisibility.NONE);
}else
wdContext.currentxxxxElement.setCountry_Column_Visible(WDVisibility.VISIBLE);
Use the above code you condition it will work.I hope it will help you.
BR,
Durga -
Display LOV based on view criteria
Hi,
I have a SelectOneChoice list in the table column. I want to display its items dynamically based on view criteria. So that when i select a row in the table, the list should have only filtered items.
I am using Jdeveloper version 11.1.1.6.0. Below is the code for SelectOneChoice list.
<af:selectOneChoice value="#{row.bindings.IntegrationName.inputValue}"
label="#{row.bindings.IntegrationName.label}"
required="#{bindings.ManageProjectIntegration1.hints.IntegrationName.mandatory}"
shortDesc="#{bindings.ManageProjectIntegration1.hints.IntegrationName.tooltip}"
id="soc5"
readOnly="#{row.EnabledFlag eq 'ACTIVE' or backingBeanScope.managed_ManageProjectIntegrationBean.singleIntegration}"
valueChangeListener="#{backingBeanScope.managed_ManageProjectIntegrationBean.validateIntegrationName}"
binding="#{backingBeanScope.managed_ManageProjectIntegrationBean.integrationChoiceList}"
autoSubmit="true" valuePassThru="false"
immediate="false"
contentStyle="width:180.0px;">
<f:selectItems value="#{row.bindings.IntegrationName.items}"
id="si7"/>
Thanks
HarishHarish,
Have you tried creating a model driven list by using the view criteria?
http://www.baigzeeshan.com/2010/03/how-to-create-adf-lov-with-view.html
-Arun
Maybe you are looking for
-
Blue screen, froozen, dead ipod.
I was charging my iPod on my computer, and after a while I decided I was going to go to my room and listen to some music. So I kindly ask my brother to disconnent my iPod. I go upstairs. He does this properly, and after he unplugs it from the compute
-
Do I need and app to eprint or can I just print from my e-mail to the printer?cc=us
I can not eprint to my printer and the services are turned on. Everytime I try to send an email to the printer to print it come back with a failure notice. Can someone please help?
-
Loading a VI infront of any loaded program
My current application is a Visual Basic program that call different VIs throught a DDE server. Some of the called VIs are input screens that the user must use to answer questions. My problem is that the called VI when it called get displayed behind
-
Can not download Boot Camp Assistant
I'm trying to download Boot Camp Assistant on my MBA, but it always stop and giving message as: download could not continue, an error occurred while downloading Windows support software I don't know how to fix this problem, anyone have experience on
-
Will sun cluster 3.2 support apache version 2.2.10 ?
Hi, will sun cluster 3.2 support apache version 2.2.10 ? Thanks Ushas Symon