Help with filter condition
Hi
I need to have a condition in the which gives available hours , considering the tester whose decommision date is not greater than the day_date.
I have 4 tables :
3 dimension tables and 1 fact table
dim_date : has all possible dates in all formats
dim_tester : has the all the tester values , and its inception ( when the tester was bought) and decommision(when the tester was decommsioned or removed)
dim_time : which has hour seg prime values , and the available hours for a day
Fct_tester_utilization : this table has the keys to link all the dimension tables and the logged hours (used hours) details.
i need to calculate available hours based on the inception date and decommision date.
A tester is considered to be online if its between inception and decommsion date, and available hours has to be calculated for all the testers online, if the tester is decommisioned then it has the date value of when its decommsioned if not it has the far value like 12/31/9999.
Here is the ddl and some sample data
CREATE TABLE EDW_DIM.DIM_DATE
DATE_KEY NUMBER(*, 0)
, DAY_DATE DATE
, SUN_WEEK_START_DATE DATE )
Sample Data:
DATE_KEY DAY_DATE SUN_WEEK_START_DATE
3260 05-DEC-10 05-DEC-10
3261 06-DEC-10 05-DEC-10
3262 07-DEC-10 05-DEC-10
3263 08-DEC-10 05-DEC-10
3264 09-DEC-10 05-DEC-10
3265 10-DEC-10 05-DEC-10
3266 11-DEC-10 05-DEC-10
3267 12-DEC-10 12-DEC-10
3268 13-DEC-10 12-DEC-10
3269 14-DEC-10 12-DEC-10
3270 15-DEC-10 12-DEC-10
3271 16-DEC-10 12-DEC-10
3272 17-DEC-10 12-DEC-10
3273 18-DEC-10 12-DEC-10
3274 19-DEC-10 19-DEC-10
3275 20-DEC-10 19-DEC-10
3276 21-DEC-10 19-DEC-10
3277 22-DEC-10 19-DEC-10
3278 23-DEC-10 19-DEC-10
3279 24-DEC-10 19-DEC-10
3280 25-DEC-10 19-DEC-10
3281 26-DEC-10 26-DEC-10
3282 27-DEC-10 26-DEC-10
3283 28-DEC-10 26-DEC-10
DIM_TESTER:
CREATE TABLE EDW_DIM.DIM_TESTER
TESTER_KEY NUMBER(10, 0) NOT NULL
, TESTER_NAME VARCHAR2(25 BYTE)
, TESTER_CATEGORY VARCHAR2(25 BYTE)
, TESTER_INCEPTION_DATE DATE
, TESTER_DECOMMISSION_DATE DATE
Sample data:
TESTER_KEY TESTER_NAME TESTER_CATEGORY TESTER_INCEPTION_DATE TESTER_DECOMMISSION_DATE
401 RFR6155-2 Bench 02-NOV-06 31-DEC-99
402 RFR6250-2 Bench 02-NOV-06 25-SEP-09
403 RFR6250-3 Bench 02-NOV-06 31-DEC-99
404 RFR6250-7 Bench 02-NOV-06 31-DEC-99
405 RFR6275-2 Bench 02-NOV-06 27-MAY-08
406 RFR6275-3 Bench 02-NOV-06 31-DEC-99
407 SMOKY Bench 02-NOV-06 31-DEC-99
408 SUGAR Bench 02-NOV-06 31-DEC-99
409 ZIF-02 Bench 02-NOV-06 31-DEC-99
410 ZIF-03 Bench 02-NOV-06 25-SEP-09
411 ZIF-04 Bench 02-NOV-06 25-SEP-09
412 ZIF-18 Bench 02-NOV-06 31-DEC-99
413 ACDC ATE 05-NOV-03 09-DEC-06
414 AEROSMITH ATE 05-FEB-05 15-OCT-09
416 BEATLES ATE 10-APR-06 02-OCT-07
417 BLAINE SIMULATOR 14-MAY-03 31-DEC-09
418 BURNS SIMULATOR 02-SEP-03 31-DEC-09
419 CAPOTE ATE 16-JUN-05 31-DEC-99
420 CHICO ATE 03-JUN-03 31-DEC-99
421 CLASH ATE 01-APR-04 09-NOV-10
422 DAPHNE ATE 29-DEC-04 31-DEC-99
424 EXACTA ATE 24-MAR-03 31-DEC-99
425 FOGHAT ATE 16-JUN-05 31-DEC-99
427 GRATEFULDEAD ATE 05-MAR-03 05-NOV-07
428 GRENACHE ATE 06-JAN-06 31-DEC-99
431 IDITAROD ATE 24-MAR-03 31-DEC-99
432 IRONMAIDEN ATE 20-JUL-03 30-JAN-07
434 LEDZEPPELIN ATE 01-FEB-05 07-NOV-10
531 RFALAB-037 Bench 01-SEP-07 31-DEC-99
532 UFLEX1 ATE 18-SEP-07 14-OCT-08
DIM_TIME
CREATE TABLE EDW_DIM.DIM_TIME
TIME_KEY NUMBER
, HOUR_SEG_PRIME VARCHAR2(50 BYTE)
Sample Data:
TIME_KEY HOUR_SEG_PRIME
1 AM-OS:12 AM - 7 AM
61 AM-OS:12 AM - 7 AM
121 AM-OS:12 AM - 7 AM
181 AM-OS:12 AM - 7 AM
241 AM-OS:12 AM - 7 AM
301 AM-OS:12 AM - 7 AM
361 AM-OS:12 AM - 7 AM
421 AM-Eng:7 AM - 9 AM
481 AM-Eng:7 AM - 9 AM
541 Prime Time:9 AM - 7 PM
601 Prime Time:9 AM - 7 PM
661 Prime Time:9 AM - 7 PM
721 Prime Time:9 AM - 7 PM
781 Prime Time:9 AM - 7 PM
841 Prime Time:9 AM - 7 PM
901 Prime Time:9 AM - 7 PM
961 Prime Time:9 AM - 7 PM
1021 Prime Time:9 AM - 7 PM
1081 Prime Time:9 AM - 7 PM
1141 PM-Eng:7 PM - 10 PM
1201 PM-Eng:7 PM - 10 PM
1261 PM-Eng:7 PM - 10 PM
1321 PM-OS:10 PM - 12 AM
1381 PM-OS:10 PM - 12 AM
FCT_TESTER_UTILIZATION:
CREATE TABLE EDW_FACT.FCT_TESTER_UTILIZATION
TESTER_KEY NUMBER(10, 0)
, DIM_DATE_KEY NUMBER(10, 0)
, DIM_TIME_KEY NUMBER(10, 0)
, LOGGED_TIME NUMBER(10, 0)
Sample Data:
DIM_DATE_KEY DIM_TIME_KEY TESTER_KEY LOGGED_TIME
3260 1 345 60
3260 1 347 60
3261 1 707 60
3261 1 708 60
3261 1 709 60
3261 1 710 60
3261 1 711 60
3261 1 713 60
3261 1 715 60
3261 1 722 60
3261 1 723 60
3261 1 724 60
3261 1 726 60
3261 61 345 60
3261 61 355 60I have calculated available hours :
Here is my query :
SQL SELECT
B.HOUR_SEG_PRIME,
t.tester_name,
TRUNC(c.DAY_DATE + 1,'IW')-1 AS Week,
c.DAY_DATE,
t.tester_inception_date,
t.tester_decommission_date,
CASE
WHEN B.HOUR_SEG_PRIME = 'AM-OS:12 AM - 7 AM' THEN 0.292
WHEN B.HOUR_SEG_PRIME = 'AM-Eng:7 AM - 9 AM' THEN 0.083
WHEN B.HOUR_SEG_PRIME = 'Prime Time:9 AM - 7 PM' THEN 0.417
WHEN B.HOUR_SEG_PRIME = 'PM-Eng:7 PM - 10 PM' THEN 0.125
WHEN B.HOUR_SEG_PRIME = 'PM-OS:10 PM - 12 AM' THEN 0.083
END
)* 24 AS "Available_Hours"
FROM dim_time B join fct_tester_utilization f
on f.dim_time_key = B.time_key
join dim_date c
on f.dim_date_key = c.date_key
join dim_tester t
on t.tester_key = f.tester_key I have not written a where condition in the above query , could any one please assist me in writing query considering the above mentioned conditions for inception and decommision dates?
Output with the above query:
WEEK TESTER_NAME DAY_DATE INCEPTION_DATE DECOMMISION_DATEAVAILABLE_HOURS
12/5/2010 BROWN 12/6/2010 11/2/2006 12/31/9999 10.01
12/5/2010 CHICO 12/11/2010 6/3/2003 12/31/9999 3.00
12/5/2010 MEGATRACE 12/8/2010 8/20/2009 8/27/2010 10.01
12/5/2010 MEGATRACE 12/9/2010 8/20/2009 8/27/2010 10.01
12/5/2010 MEGATRACE 12/10/2010 8/20/2009 8/27/2010 10.01
12/5/2010 MERLOT 12/5/2010 3/24/2003 12/31/9999 7.01
12/5/2010 MEZCAL 12/5/2010 6/2/2006 12/31/9999 7.01
12/5/2010 OUZO 12/11/2010 4/23/2008 12/31/9999 1.99
12/5/2010 RFALAB-080 12/9/2010 1/17/2009 12/31/9999 10.01
12/5/2010 RFR6275-2 12/8/2010 11/2/2006 5/27/2008 10.01
12/12/2010 MEGATRACE 12/13/2010 8/20/2009 8/27/2010 10.01
12/12/2010 MEGATRACE 12/16/2010 8/20/2009 8/27/2010 10.01
12/12/2010 MEZCAL 12/18/2010 6/2/2006 12/31/9999 7.01
12/19/2010 MARCO 12/25/2010 3/24/2003 12/31/9999 7.01
12/19/2010 MEGATRACE 12/21/2010 8/20/2009 8/27/2010 10.01
12/19/2010 MEGATRACE 12/22/2010 8/20/2009 8/27/2010 10.01
12/19/2010 MERLOT 12/22/2010 3/24/2003 12/31/9999 10.01
12/26/2010 MALBEC 12/27/2010 4/14/2006 12/31/9999 10.01
12/26/2010 MARCO 1/1/2011 3/24/2003 12/31/9999 7.01
12/26/2010 MEGATRACE 12/28/2010 8/20/2009 8/27/2010 10.01In the above output the tester MEGATRACE has already been decommsioned on 8/27/2010 but still there is a day_date , i should not calculate available hours for the testers which have already been decommisoned.
Expected Output :
WEEK TESTER_NAME DAY_DATE TESTER_INCEPTION_DATE TESTER_DECOMMISION_DATE AVAILABLE_HOURS
12/5/2010 BROWN 12/6/2010 11/2/2006 12/31/9999 10.01
12/5/2010 CHICO 12/11/2010 6/3/2003 12/31/9999 3.00
12/5/2010 MERLOT 12/5/2010 3/24/2003 12/31/9999 7.01
12/5/2010 MEZCAL 12/5/2010 6/2/2006 12/31/9999 7.01
12/5/2010 OUZO 12/11/2010 4/23/2008 12/31/9999 1.99
12/5/2010 RFALAB-080 12/9/2010 1/17/2009 12/31/9999 10.01
12/12/2010 MEZCAL 12/18/2010 6/2/2006 12/31/9999 7.01
12/19/2010 MARCO 12/25/2010 3/24/2003 12/31/9999 7.01
12/19/2010 MERLOT 12/22/2010 3/24/2003 12/31/9999 10.01
12/26/2010 MALBEC 12/27/2010 4/14/2006 12/31/9999 10.01
12/26/2010 MARCO 1/1/2011 3/24/2003 12/31/9999 7.01
12/26/2010 MEGATRACE 8/26/2010 8/20/2009 8/27/2010 10.01The last day_date for Megatrace should not be greater than the decommsionned date.Please Help
Edited by: user13502884 on Feb 10, 2011 11:11 AM
Edited by: user13502884 on Feb 10, 2011 1:23 PM
Edited by: user13502884 on Feb 10, 2011 1:24 PM
Peter Gjelstrup wrote:
user13502884 wrote:
Please let me know if my question is not clear ....My personal opinion: Too much work to be done, turning you sample data into something usuable. Had you posted it as insert statements, several people might already be working at your issue.
Right now, I haven't even read it to the end..
Sorry to say
PeterThere is so much of data for a week , so i was unable to figure out how much sample data i can post , please look into the last set of sample data obtained by my query , which gives an idea of what i am looking into...
is there a way where i can send some excel files?
Similar Messages
-
I need help with the conditional build tag option RoboHelp 10
I need help with the conditional build tag option. I want to apply CBT to content in a topic. I looked at the Help topics and believed that I applied the feature correctly. Howver, it is not working as desired. In the 2nd sentence below I want the text highlighted in blue to only appear for the printed output and the text printed in purple to only appear for the .htm /online output. Please help.
There are common tasks used to manage the folders in the Navigator and the folders
in the BBS Folders Viewer Grid. For more information on these common tasks see Help
and Support in Success Enterprise. click the links below.Hi there
Using tagging is a two part process.
Part One
You create and apply the tags to the information you wish to control.
Part Two
You create a Build Expression that is used when you generate your output. The Build Expression typically reads something like: NOT Tag1 (or whatever your tag name is)
Then when you generate and use the Build Expression, the information tagged is not included in the build.
Cheers... Rick -
Outer join with Filter condition
Hi there,
I need some help with Data Services. I am creating an outer join between two tables and one of them has filter condition but it creates and outerjoin and apply the filter condition to the whole result set.
SELECT "IWFMR13T_VEH_NTK_TMP1"."ACTY_DT" , "IWFMR13T_VEH_NTK_TMP1"."VEH_CL" , "IWFMR13T_VEH_NTK_TMP1"."VEH_NO" , "IWFMR13T_VEH_NTK_TMP1"."SRVC_NO" , "IWFMR13T_VEH_NTK_TMP1"."SRVC_STRT_DT" , "IWFMR13T_VEH_NTK_TMP1"."FR_SRVC_SEQ_NO" , "IWFMR13T_VEH_NTK_TMP1"."TO_SRVC_SEQ_NO" , "IWFMR13T_VEH_NTK_TMP1"."FR_ACTY_TS" , "IWFMR13T_VEH_NTK_TMP1"."TO_ACTY_TS" , "IWFMR13T_VEH_NTK_TMP1"."MINS_ON_TRN" , "IWFMR13T_VEH_NTK_TMP1"."VEH_STA_CD" , "IWFMR13T_VEH_NTK_TMP1"."MAJ_VEH_CD" , "IWFMR13T_VEH_NTK_TMP1"."VEH_DIST_KM" , "IWFMR13T_VEH_NTK_TMP1"."VEH_NET_TN" , "IWFMR13T_VEH_NTK_TMP1"."VEH_GROS_TN" , "IWFMR13T_VEH_NTK_TMP1"."VEH_NTK" , "IWFMR13T_VEH_NTK_TMP1"."VEH_GTK" , "IWFMR13T_VEH_NTK_TMP1"."HLNG_LOCO_MPU" , "IWFMR13T_VEH_NTK_TMP1"."09_HLNG_LOCO_FL" , "IWFMR13T_VEH_NTK_TMP1"."LOCO_MPU" , "IWFMR11T_SGMT_LCNT"."SUM_LOCO_MPU" , "IWFMR13T_VEH_NTK_TMP1"."SRVC_BUS_GRP_CD" , "IWFMR13T_VEH_NTK_TMP1"."SRVC_COAL_MRKR_CD"
FROM "DBO"."IWFMR13T_VEH_NTK_TMP1" "IWFMR13T_VEH_NTK_TMP1"
LEFT OUTER JOIN "DBO"."IWFMR11T_SGMT_LCNT" "IWFMR11T_SGMT_LCNT"
ON ( "IWFMR11T_SGMT_LCNT"."SRVC_NO" = "IWFMR13T_VEH_NTK_TMP1"."SRVC_NO" ) AND( "IWFMR11T_SGMT_LCNT"."SRVC_STRT_DT" = "IWFMR13T_VEH_NTK_TMP1"."SRVC_STRT_DT" ) AND( "IWFMR11T_SGMT_LCNT"."FR_SRVC_SEQ_NO" = "IWFMR13T_VEH_NTK_TMP1"."FR_SRVC_SEQ_NO" ) AND( "IWFMR11T_SGMT_LCNT"."TO_SRVC_SEQ_NO" = "IWFMR13T_VEH_NTK_TMP1"."TO_SRVC_SEQ_NO" )
WHERE ( "IWFMR13T_VEH_NTK_TMP1"."09_HLNG_LOCO_FL" = 'Y')
While, what I need is as under
SELECT "IWFMR13T_VEH_NTK_TMP1"."ACTY_DT" , "IWFMR13T_VEH_NTK_TMP1"."VEH_CL" , "IWFMR13T_VEH_NTK_TMP1"."VEH_NO" , "IWFMR13T_VEH_NTK_TMP1"."SRVC_NO" , "IWFMR13T_VEH_NTK_TMP1"."SRVC_STRT_DT" , "IWFMR13T_VEH_NTK_TMP1"."FR_SRVC_SEQ_NO" , "IWFMR13T_VEH_NTK_TMP1"."TO_SRVC_SEQ_NO" , "IWFMR13T_VEH_NTK_TMP1"."FR_ACTY_TS" , "IWFMR13T_VEH_NTK_TMP1"."TO_ACTY_TS" , "IWFMR13T_VEH_NTK_TMP1"."MINS_ON_TRN" , "IWFMR13T_VEH_NTK_TMP1"."VEH_STA_CD" , "IWFMR13T_VEH_NTK_TMP1"."MAJ_VEH_CD" , "IWFMR13T_VEH_NTK_TMP1"."VEH_DIST_KM" , "IWFMR13T_VEH_NTK_TMP1"."VEH_NET_TN" , "IWFMR13T_VEH_NTK_TMP1"."VEH_GROS_TN" , "IWFMR13T_VEH_NTK_TMP1"."VEH_NTK" , "IWFMR13T_VEH_NTK_TMP1"."VEH_GTK" , "IWFMR13T_VEH_NTK_TMP1"."HLNG_LOCO_MPU" , "IWFMR13T_VEH_NTK_TMP1"."09_HLNG_LOCO_FL" , "IWFMR13T_VEH_NTK_TMP1"."LOCO_MPU" , "IWFMR11T_SGMT_LCNT"."SUM_LOCO_MPU" , "IWFMR13T_VEH_NTK_TMP1"."SRVC_BUS_GRP_CD" , "IWFMR13T_VEH_NTK_TMP1"."SRVC_COAL_MRKR_CD"
FROM "DBO"."IWFMR13T_VEH_NTK_TMP1" "IWFMR13T_VEH_NTK_TMP1"
LEFT OUTER JOIN "DBO"."IWFMR11T_SGMT_LCNT" "IWFMR11T_SGMT_LCNT"
ON ( "IWFMR11T_SGMT_LCNT"."SRVC_NO" = "IWFMR13T_VEH_NTK_TMP1"."SRVC_NO" ) AND( "IWFMR11T_SGMT_LCNT"."SRVC_STRT_DT" = "IWFMR13T_VEH_NTK_TMP1"."SRVC_STRT_DT" ) AND( "IWFMR11T_SGMT_LCNT"."FR_SRVC_SEQ_NO" = "IWFMR13T_VEH_NTK_TMP1"."FR_SRVC_SEQ_NO" ) AND( "IWFMR11T_SGMT_LCNT"."TO_SRVC_SEQ_NO" = "IWFMR13T_VEH_NTK_TMP1"."TO_SRVC_SEQ_NO" ) AND ( "IWFMR13T_VEH_NTK_TMP1"."09_HLNG_LOCO_FL" = 'Y')
Please let me know, how to fix this issue. If you have come across such issue before. If need be I can send you the ATL file for this data flow.
BTW, I am using Data Services XI 3.2 (12.2.0.0) and the database is SQL 2005, both on Windows Platform.
Thanks & regards,
Doshi BhaveshHi,
Use two query transforms;
First will only connect to IWFMR13T_VEH_NTK_TMP1 and use it to apply filter "IWFMR13T_VEH_NTK_TMP1"."09_HLNG_LOCO_FL" = 'Y'
In second query transform perform outer join on IWFMR11T_SGMT_LCNT and output of first query.
This should give required result.
If you are using single query transform join will be performed at DB level and if you use custom sql in query transform it will not have increased load on DB. I will recommend to use custom sql to get good performance.
Sachin -
Need help for filter condition
Hello All,
I am currently using Oracle 10g and stuck for the filter condition.
We have incident numbers and 5 activities to complete that incident. All the activities are same for each incident. When status of all the activities are done the incident is supposed to be completed.
In my scenario, I want to select only those incidents where 2 (activity BB and CC) of 5 activities have status 'Done' and 1 activity (activity DD) has status 'Done' or 'Not Applicable'. I have tried to do this by certain filter combinations but couldnt achieve required result. I hope I will get this query answered here.
Below is sample table.
Incident Number
Activity Name
Activity Status
10
AA
In Progress
10
BB
Done
10
CC
In Progress
10
DD
Done
10
EE
Not Started
20
AA
In Progres
20
BB
Done
20
CC
Done
20
DD
Not Applicable
20
EE
Done
My selection criteria is
Activity Name
Activity Status
BB
Done
CC
Done
DD
Done or Not Applicable
Now, in this case I would like to see incident number 20 only in my result as it has BB activity Done, CC activity Done and DD activity Not Applicable which serves my criteria.
Any help will greately appreciated.
Thanks,
Shantanu971628 wrote:
Hi RaminHashimzadeh,
My selection criteria is
Activity Name
Activity Status
BB
Done
CC
Done
DD
Done or Not Applicable
I dont want incident numbers where status of activity BB and CC = Not Applicable. It should only be 'Done' for BB and CC. It could be 'Done' or 'Not Applicable' only for DD activity. Your query would not serve my requirement.
OK
check this :
select Incident from t
group by Incident
having count(case when (ActivityStatus = 'Done' and Activity in ('BB','CC')) or
(ActivityStatus in ('Done','Not Applicable') and Activity = 'DD')
then 1 end) = 3
Ramin Hashimzade -
File Upload Problem - help with a condition
Dear all,
I have built a form that includes a file upload. Everything works great until I don't include a file for upload(!) It wont allow me to "not" upload a file, it throws an error at me. My database allows this field to be blank. Do I have to wite some sort of condition that allows the file field to be blank, if so, could anyone help with it?
Many thanksHello,
Can any one at Adobe help with this please as I still cannot understand why I am forced to upload a file with the file upload control. What happens if I dont want to add a file with my insert form??? I get errors if I do not include a file:
Developer Details:
Folder error. Security Error. Folder 'C:\Inetpub\Www_root\absbiodiesel.co.uk\' is out of base folder 'C:\Inetpub\Www_root\absbiodiesel.co.uk\NewsArticles\'. (FOLDER_DEL_SECURITY_ERROR)
tNG Execution Trace - VIEW
tNG_insert.executeTransaction
STARTER.Trigger_Default_Starter
tNG_insert.doTransaction
BEFORE.Trigger_Default_FormValidation
tNG_insert.prepareSQL
tNG_insert.executeTransaction - execute sql
tNG_insert.postExecuteSql
AFTER.Trigger_FileUpload*
ERROR.Trigger_Default_Insert_RollBack
tNG_insert.getRecordset
tNG_insert.getFakeRsArr
tNG_insert.getLocalRecordset
tNG_insert.getFakeRecordset
tNG_insert.getFakeRecordset -
Help with pricing condition??
Hi Guyz,
I have a requirement with my client, the want to supply material to an external customer at an intercompany price(ZPR9). So whenever a sales order is created for this specific customer it should pull the price from Intercompany price(ZPR9). I have a option to create new pricing procedure and new pricing condition but this condition should pick up the price from ZPR9 so that we don't have to define the price manually like we do in PR00.
I can't able to assign ZPR9 to my new pricing procedure because ZPR9 is use for intercompany and this customer doesn not belong to any of our company code.So the situation is i have to define new pricing procedure and new pricing condition but this condition should pull the price from ZPR9.
when I see the details of ZPR9(condition type) its condition category is assigned as 'Y' which is customer reserve Y. I am not sure what this is.So could you plz advice how to handle this whole scenario. Appreciate your help.
thanks
Mohammed.mohammed,
This type of requirement is hard to handle and if you do it in a wrong way, whoever support this process later will have a hard time.
Anyway, I think one of the twisted ways of doing this is to use Alternative Culculation routine and put the logic to get the condition right out of price condition table (A*) of ZPR9. This is not flexible at all because this involves hard coding, so I do not recommend this.
The message I can get from your client is "We don't want to maintain the same condition here and there," but sometimes they have to deal with it, because the nature of the condition type is very different from business point of view.
Having said that, in order for them to have easier way to create the condition, maybe you can develop a custom ABAP to copy ZPR9 condition into the new condition you might be creating, and either have them run the program every time they update ZPR9 or schedule the job.
Hope this helps.
Akio -
I have three parameters in my report which are academic year, instance code and id number. Only two parameter values are entered when user runs report, that is, either academic year and id number or academic year and instance code.
The report produces a student’s statement of results and should show all results for the previous years. E.g. if student did c-inst1 in 2009, c-inst2 in 2010, c-inst3 in 2011, when user enters 2011 for parameter academic year and c-inst3 as course instance, the report should display all the results of students starting from 2011 going back to 2009 for all the three course instances c-inst1, c-inst2 and c-inst3.
My report conditions are as below:
ACADEMIC_SESSION <= :ACADEMIC_YEAR AND
(Id_NUMBER = :ID_NUMBER OR (:ID_NUMBER IS NULL AND (CI.INSTANCE_CODE = :course_instance OR What?? ) What condition should I add here in order to get all those records with course instance entered as well as previous course instances done by a student?
Please assist. Thanks.user8655468 wrote:
I have three parameters in my report which are academic year, instance code and id number. Only two parameter values are entered when user runs report, that is, either academic year and id number or academic year and instance code.
The report produces a student’s statement of results and should show all results for the previous years. E.g. if student did c-inst1 in 2009, c-inst2 in 2010, c-inst3 in 2011, when user enters 2011 for parameter academic year and c-inst3 as course instance, the report should display all the results of students starting from 2011 going back to 2009 for all the three course instances c-inst1, c-inst2 and c-inst3.
My report conditions are as below:
ACADEMIC_SESSION <= :ACADEMIC_YEAR AND
(Id_NUMBER = :ID_NUMBER OR (:ID_NUMBER IS NULL AND (CI.INSTANCE_CODE = :course_instance OR What?? ) What condition should I add here in order to get all those records with course instance entered as well as previous course instances done by a student?You can use lexical parameter in reports sql and pass the condition whatever u want. How can we do that ?
1. create a parameter like PR with char data type.
2. pass the column name and other parameter to this parameter via After Parameter Form trigger.
Hope this will help you. -
--Sample create/insert :
create table xxdummy(
id integer,
name varchar2(40),
description varchar2(100)
insert into xxdummy values (1,'L', 'Simple L press');
insert into xxdummy values (2,'XL', 'XL with no film');
insert into xxdummy values (2,'web', 'XL with no film');
insert into xxdummy values (3,'XL', 'XL with Film');
insert into xxdummy values (3,'Film', 'XL with Film');
insert into xxdummy values (3,'print', 'XL with Film');
insert into xxdummy values (4,'S', 'servo with film');
insert into xxdummy values (4,'Film','servo with film' );
insert into xxdummy values (5,'S','only servo' );
insert into xxdummy values (6,'L', 'Simple L press');
insert into xxdummy values (7,'XL', 'XL with no film');
insert into xxdummy values (8,'XL', 'XL with Film');
insert into xxdummy values (8,'Film', 'XL with Film');
insert into xxdummy values (8,'guide', 'XL with Film');
--drop table xxdummy;
select * from xxdummy;
select id, description, decode(name, 'L', 'L Only', 'XL', 'Got XLs here', 'dont know' ) type
from xxdummy
where name in ('L','XL' )
In above query for column type, I want to display 'L Only', 'XL With Film', 'XL Without Film'
How can I do this ?
ThanksI should have explained more, but my mind is so fried making up sample replica of the data as its scattered over so many tables in the original query taht I couldnt put it properly:
another try :
column Description is just for my reference , So please ignore that for now.
I have to form a condition only using colums name and id.
select * from xxdummy :
id=2 and 7 , has name=XL but doesnt have 'Film' so I want to mark this row as 'XL with no film'
id=3 and 8 , has name=XL and also has name = Film, So label for this should be - XL With Film
id=4 , has name=S and also Film, --All the ids that have name=S, no matter if it has film with same Id should be excluded.
id=5, exclude it
id=1 and 6 have name = L , Lable them 'L Only' .
So I should basically have 6 rows returned in my sample data :
select id, description, name, decode(name, 'L', 'L Only', 'XL', 'Got XLs here' ,'dont know') type
from xxdummy
where name in ('L','XL')
how do I distinguish within id, that has name=XL : which one has film and which one doesnt
did it sound better ?
Edited by: OAF-dev on Nov 17, 2009 4:10 PM -
I have a really stupid problem that I can't figure out so I'm
hoping someone here might be able to figure out what is wrong:
http://www.exitplaystation.com/ps3/warhawk/trophies.php
Ok, my first and most important question is why, when you
click a check box the box does not check off. I have tested in
Safari and Firefox and I cannot figure out what is missing.
The second question is something I thought of just now while
typing my stupid question. Instead of using the odd/even row, is
there a way to color code the rows based on a value from the XML
data? For example, if LEVEL = x color the row white, if LEVEL = y
color the row black, if LEVEL = z color the row red. I know there
is probably some javascript involved, but I wasn't sure if there
was a built-in function with the Spry that would do this for me
without having to write a function for it.Well, for one thing, it means your filters are getting called
correctly.
When a filter is activated, the region is redrawn, meaning
all the markup is replaced with the new data.
This means that when you click a checkbox, your filter is run
and the region immediately redrawn, which means your checkboxes are
redrawn back to unchecked.
What V1 means is to take your checkboxes and move them
outside of the spry:region. That means that they won't be redrawn
when you filter. It is static markup, so there is no real reason
for it to be within the region.
For the classes, the easiest way is to make class names that
are the same as the data value for that row.
Then you just do:
<tr id="repeatRow" class="{level}">
and your classes will be:
.y {background-color: white;}
.x {background-color: gray;}
Make sense? -
Hi All,
I have a requirement to split the below query based on conditions. This should be done in SQL.
SELECT cv.chr_val_code MOD_CODE,
cv.chr_val_id MOD_ID,
f_char_value_dscr(cv.chr_val_id, 4,1) MOD_DSCR,
f_char_value_dscr(schsg.prnt_chr_val_id,4, 1) MOD_SCHEMA,
cv.mod_typ MOD_TYPE,
f_char_value_dscr(sgpg.prnt_chr_val_id,4,1) MOD_SUPERGROUP,
f_char_value_dscr(sgpg.chld_chr_val_id,4,1) MOD_PRODUCTGROUP,
f_char_value_dscr(lpgpc.CHLD_CHR_VAL_ID,4,1) "LOCAL PC",
f_char_value_dscr(lpgpc.PRNT_CHR_VAL_ID,4,1) "LOCAL PRODUCTGROUP",
f_char_value_dscr(lsgpg.CHLD_CHR_VAL_ID,4,1) "LOCAL SUPERGROUP",
cv.cnsldtd_item_mod MOD_CONSOLIDATED
FROM chr_val_t cv
INNER JOIN chr_t c
ON c.chr_id = cv.chr_id
AND c.chr_typ_ref_id = pkg_grd_global.f_get_ref_id_by_val('GLOBAL MODULE','CHARACTERISTIC TYPE')
OR c.chr_typ_ref_id = pkg_grd_global.f_get_ref_id_by_val('LOCAL PC','CHARACTERISTIC TYPE')
INNER JOIN hier_elmnt_t pgmod
ON cv.chr_val_id = pgmod.chld_chr_val_id
INNER JOIN hier_elmnt_t sgpg
ON sgpg.chld_chr_val_id = pgmod.prnt_chr_val_id
INNER JOIN hier_elmnt_t schsg
ON schsg.chld_chr_val_id = sgpg.prnt_chr_val_id
INNER JOIN hier_elmnt_t lpgpc
ON cv.chr_val_id = lpgpc.CHLD_CHR_VAL_ID
INNER JOIN hier_elmnt_t lsgpg
ON lsgpg.CHLD_CHR_VAL_ID = lpgpc.PRNT_CHR_VAL_ID
WHERE cv.del_ind = 'N' and c.rgn_id = 9 --GLOBAL REGION ID
Basically what i need to do now is, say suppose c.rgn_id = 9 then i need to show the below fields
cv.chr_val_id MOD_ID,
f_char_value_dscr(cv.chr_val_id, 4,1) MOD_DSCR,
f_char_value_dscr(schsg.prnt_chr_val_id,4, 1) MOD_SCHEMA,
cv.mod_typ MOD_TYPE,
f_char_value_dscr(sgpg.prnt_chr_val_id,4,1) MOD_SUPERGROUP,
f_char_value_dscr(sgpg.chld_chr_val_id,4,1) MOD_PRODUCTGROUP
and if c.rgn_id != 9 then i need to show
f_char_value_dscr(lpgpc.CHLD_CHR_VAL_ID,4,1) "LOCAL PC",
f_char_value_dscr(lpgpc.PRNT_CHR_VAL_ID,4,1) "LOCAL PRODUCTGROUP",
f_char_value_dscr(lsgpg.CHLD_CHR_VAL_ID,4,1) "LOCAL SUPERGROUP",
cv.cnsldtd_item_mod MOD_CONSOLIDATED
both the above 2 split conditins should be fetching from the same FROM clause
pls advise..Hi Harry (nice name by the way),
Do you actually want to have different numbers of columns in the output or do you just want null shown if rgn_id is/isnt 9?
If you just want nulls then you can do it easily with a case statement
i.e. case rgn_id=9 then xxx else xxx - you can google an example easy enough
If you want dynamic columns it gets more complicated and you may have to look at pipelined functions or some other solution to do this.
Cheers,
Harry -
Please i need help with this condition
ok this my situation and try to help me simpler than this
i have 3 input test fields named
name_txt , emailTxt , phonetxt.
and i have a text file named "question.txt" at the same
folder.
i have three dynamic textfields that load &ques1 ,
&ques2 and &ques3
and i want to do the following:
i want to compare between the answers the user input and the
answers at the
txt file &answer1,&answer2 and &answer3.
For example:
_root.submit_btn.onRelease = function(){
if ( _root.nametxt.text = = My variable ????){
gotoAndPlay(2);
} else{
gotoAndPlay(3);
AND THE CODE I AM USING IS :
//on frame 1
stop();
_root.loadVariables("ques.txt");
/*and my input txts named as following
name_txt
email_txt
phone_txt
and the text file ques.txt read as following:
&firstQ=What is your name?
&secondQ=What is your email?
&thirdQ=What is your mobile number?
&answer1=Essam
&answer2= my email
&answer3=0124613121
and i want to make a condition to compare between text input
in the
name_txt,email_txt and phone_txt and &answer1,
&answer2 , &answer3 and
that if ok gotoAndStop(where the next ques is) ;
Please help me that way and thank you for your efforts in
advanceCreate two condition type
ZCAH and ZCAS
Set up ZCAH condition type as positive and ZCAS for negative.
Then in calculation schema, enter the ZCAH and then ZCAS condition type
Next enter the total and give the "from and to" as bellow screen.
Then whenever you will give any amount in condition type ZCAH and ZCAS, the total will appear as ZCAH-ZCAS.
For more details please read the blog Pricing procedure Steps and Details in SAP MM
Regards
Dëv -
Need help with a conditional calculation...
I have a field that the user chooses as either a percentage of their income, or as a dollar amount. Based on what they choose, I'm using actions to show/hide the unchecked field. When using the percentage, it takes the annual salary that they input and divides it by the percentage they input, and displays that dollar amount in another field. Problem is I get an "arithmitic over/underflow" error. And it also seems to be keeping the values, ie; if I select "Dollar" and input an amount, but then uncheck "Dollar" and selet "Percent", it keeps the dollar amount in the equation. Hope that makes sense.
UPDATE:
Upon thinking further, if I could just have it to where if I was to input a value into the percent box, and there was a value present in the dollar field, it would delete the value from dollar and vice versa that would be great!
UPDATE 2:
I have the previous issue solved, but I get the following error
The only thing I can think is that by default, I have the anualSalary field set to a default of $1.00. It does the calculation correctly, but I keep geting that error. Any ideas?Hi,
the arithmetic over/underflow happens if any of the values used in a script is 0.
You can wrap you script in a if expression to avoid this problem.
if (annualSalary gt 0 and percent gt 0) then
$ = annualSalary / percent / 24 -
Help with mapping a particular process
I have 3 tables in this mapping process.
a. I have a dimension table which consists of customer information.
b. The 2nd table is a dimension table which is customer address information. This table is a child to customer information table.
c. The last table is a fact table.
The structure for the following tables are:
a. Customer Key, Customer_ID, Customer Name (Customer Key is created when this table is loaded from stage)
b. Customer Key, Pref_ind, Address1, City, State, Country, Zip and Location Key (it gets populated from the location table based on State, Country and Zip). The address information is populated from the stage. There is a lookup for customer key based on customer_id.
c. Customer Key, Location Key, Sales Amount
I need to update location_key in the fact table based on the key present in customer address table and pref_ind = 'Y'
I have a key lookup transformation for ID in the fact table and get the customer_key from customer table. The other columns are loaded for this fact table. I need to update Location Key in the same mapping. I am taking the customer key from customer transformation mapping to another lookup which looks up the customer address view(This view is an SQL with filter condition) and joins customer_key in the lookup to customer_key in customer_address table.
I cannot do this mapping because the tool generates an error stating that there are 2 different data sources1. Check the new Kimball Design Tip #95 per your "split customer" model. You may have reasons for the split dim, but in general I recommend that you keep all customer data together in one dimension. If you can combine the two dims, you will (probably) eliminate the second lookup and your issue.
2. Your description is not clear, but look at your mappings. Are any data paths "sidestepping" the lookup customer_key to address customer_key join?
tk -
I just got an interesting project where I'm asked to filter noise and raise the level of a voice recording that was probably done by an answering machine, hand recorder or other such low-fi device. You can barely hear the female voice above the room noise and audio hiss. Similar to a lecture hall with air conditioning motors or electrical buzzing near the recorder and the source voice perhaps 30 feet away, with no microphone. The noise is more consistant than the speaker.
Can anyone recommend a filter or group of filters within Logic to start with?I'm not hopeful for using anything within Logic - the voice seems too close to the surrounding noise, so a gate won't help much. The hiss is fairly easy, but the electrical noises and motor sounds might be too mixed in with the voice to allow much filtering without destroying the vocal itself.
If this is important to you, you might try SoundSoap. It has tools that might help, as it can sample the noise and apply a filter to reduce it, as long as you have a section that has no voice which you can sample.
http://www.bias-inc.com/products/soundsoappro/
It's not cheap, though.
You could try using a combination of Logic's Expander and Match EQ and experiment, but you describe a situation that's going to be really tough.
Good luck! -
Create two logical columns with same LTS mapping but diff filter conditions
Hi,
Problem:
How to create two logical columns within same logical table mapped to same physical column but different filter conditions?
I have a scenario where in,
Physical layer columns
- table1.employee
- table1.emp_city
I need a columns in logical layer:
Logical layer - lt1.count_emp_delhi (counts distinct employees whose city_name = 'Delhi')
lt1.count_emp_mumbai(counts distinct employees whose city_name = 'Mumbai')
My approach:
For Delhi column
1. Create a logical column lt1.count_emp_delhi mapped to the physical column table1.employee
2. Aggregate using countdistinct in aggregate tab.
3. Edit the mapping condition
3.1. Use the where clause and set table1.emp_city='Delhi'.
For Mumbai column.
Followed the same approach as above but in 3.1 if I change the condition to 'Mumbai', even the delhi column is populated with mumbai count which is ERRONEOUS
Could some one please help?Hi,
1. Create two alias tables for table1 in Physical Layer. Lets say TB_Mumbai and TB_Delhi
2. Create a logical table in BMM layer (D1 Employee Cities )
3. Drag and drop the employee & emp_city columns from both alias tables (TB_Mumbai and TB_Delhi ) into your newly created logical table.
4. Now you can see two Logical Table Sources (TB_Mumbai and TB_Delhi )
5. Now using Where condition, write the condition on each table
NOTE: Don't write any condition on the Physical table Table1.
Hope it helps you.
Regards,
Kalyan Chukkapalli
http://123obi.com
Maybe you are looking for
-
Applying Animation Presets from Adobe Bridge?
I haven't used this feature in a long time, so I don't know if this is a configuration problem on my PC or something I am doing wrong. In the flyout menu of the Effects and Presets panel, selecting ""Browse Presets" brings up Adobe Bridge. If I doubl
-
System Preferences not detecting intel high definition audio
I have tried researching as much as possible before posting and I just can't find a solution. I have a 2.4GHz Intel Core i7 Macbook Pro late 2011 running Mavericks 10.9.4 (13E28) on 8 GB RAM and Intel HD Graphincs 3000 512 MB, and my audio devices ar
-
Resizing image from 72 dpi from FCP
When re sizing an image which is 72 DPI in Gimp, exported from FCP, what dimensions should I enter for size of image when transposing to 300DPI? Images into Gimp from Panasonic GH2 are 4976/2800 pixels. Catherine?
-
Setting a specific time for a "hold?"
Is there a way for me to set a SPECIFIC time for a "hold?" CNTRL+D gives me a duration of an effect, but I can't seem to do the same after I add a "hold." Instead, I have to MANUALLY slide the handle of the red "hold bar" until I achieve my desired l
-
How come Flex Builder does not complain when semi-colons are omitted for AS3 statements?
Hi, I was wondering why my flexbuilder3 plugin for eclipse does not complain when and if I leave off a semi-colon at the end of an AS3 statement. Has anybody else experience this in their flex environments? What can I do to fix this; as this is very