Adding rows based on current and next row
I got some excellent help on multiplying rows based on start and end date in this
thread, resulting in the query below. It helps me follow Vehicle activity and Vehicle allocation of our vehicles day by day. Now I would like to add another feature to the query, if it is possible.
The problem is that in our database, only actual tasks are registered, which means that the time when the vehicle is between tasks is not showing. I could of course calculate total available time per vehicle and month, but that would not tell me where the
vehicles are waiting, when during the day, etc.
So I would like to insert rows for when the vehicles are standing still, and the logic would be something like this:
If vehicle number on current row equals vehicle number on the next row and End (date/time) of current row < Start (date/time) of next row, insert row after current row. Set Start=End of current row and End=Start of next row. Set From=To
of current row and To=To of current row. Set Vehicle activity to "Not active". Finaly copy all other fields from current row.
Is this possible to achieve in Power Query?
Brgds,
Caj
let
Source = Sql.Databases("sql10"),
SLM = Source{[Name="SLM"]}[Data],
dbo_V_LKPI = SLM{[Schema="dbo",Item="V_LKPI"]}[Data],
RenamedColumns = Table.RenameColumns(dbo_V_LKPI,{{"ActualDeparture", "Start"}, {"ActualArrival", "End"}}),
Records = Table.ToRecords(V_LocoKPI),
DateTime.IsSameDay = (x, y) => Date.Year(x) = Date.Year(y) and Date.Month(x) = Date.Month(y) and Date.Day(x) = Date.Day(y),
Expand = (x) => List.Generate(
() => Record.Combine({x, [End=Date.EndOfDay(x[Start])]}),
(record) => record[Start] <= x[End],
(record) => let
NextStart = Date.StartOfDay(Date.AddDays(record[Start], 1)),
NextEnd = Date.EndOfDay(NextStart),
ThisEnd = List.Min({NextEnd, x[End]})
in
Record.Combine({record, [Start=NextStart, End=ThisEnd]})),
Transformed = List.Transform(Records, each if DateTime.IsSameDay([Start], [End]) then {_} else Expand(_)),
Combined = List.Combine(Transformed),
Result = Table.FromRecords(Combined)
in
Result
Csten
Here's some sample code. Again, we use List.Generate to build either a record or a list of records and then use List.Combine to bring the results back together before converting them to a table.
let
CombineTwoRows = (x, y) =>
let
combine = x[Vehicle] = y[Vehicle] and x[End] < y[Start],
added = Record.Combine({x, [Start=x[End], End=y[Start], Active=false]}),
result = if combine then {added, y} else {y}
in result,
GenerateStandingRows = (table, combine) =>
let
Handle = (x, y) => {x, y},
buffered = Table.Buffer(table),
n = Table.RowCount(buffered),
windows = List.Generate(
() => {1, {buffered{0}}},
(x) => x{0} <= n,
(x) => {x{0} + 1, if x{0} < n then combine(buffered{x{0}-1}, buffered{x{0}}) else {buffered{x{0}}}},
(x) => x{1})
in
windows,
InsertInactivity = (table) => Table.FromRecords(List.Combine(GenerateStandingRows(table, CombineTwoRows))),
TestData = Table.FromRows({
{1, #datetime(2014, 2, 23, 13, 0, 0), #datetime(2014, 2, 23, 13, 10, 0), true},
{1, #datetime(2014, 2, 23, 13, 20, 0), #datetime(2014, 2, 23, 13, 30, 0), true},
{2, #datetime(2014, 2, 23, 13, 20, 0), #datetime(2014, 2, 23, 14, 0, 0), true},
{2, #datetime(2014, 2, 23, 14, 20, 0), #datetime(2014, 2, 23, 14, 40, 0), true},
{2, #datetime(2014, 2, 23, 16, 0, 0), #datetime(2014, 2, 23, 17, 0, 0), true},
{2, #datetime(2014, 2, 24, 2, 0, 0), #datetime(2014, 2, 24, 3, 0, 0), true},
{3, #datetime(2014, 2, 24, 1, 0, 0), #datetime(2014, 2, 24, 8, 0, 0), true},
{3, #datetime(2014, 2, 24, 9, 0, 0), #datetime(2014, 2, 24, 10, 0, 0), true}
}, {"Vehicle", "Start", "End", "Active"})
in
InsertInactivity(TestData)
Similar Messages
-
QUery retrieving based on previous and after rows.. pls help
CREATE TABLE "POP"."RP06"
( "NUM" NUMBER(7,0),
"SEQ_LINE" NUMBER(7,0),
"CHMP" VARCHAR2(4000 BYTE)
Insert into RP06 (NUM,SEQ_LINE,CHMP) values (100,1,'( ');
Insert into RP06 (NUM,SEQ_LINE,CHMP) values (100,2,'ORACLE IS GREAT');
Insert into RP06 (NUM,SEQ_LINE,CHMP) values (100,3,'AND ');
Insert into RP06 (NUM,SEQ_LINE,CHMP) values (100,4,'ORACLE IS GREAT');
Insert into RP06 (NUM,SEQ_LINE,CHMP) values (100,5,'OR ');
Insert into RP06 (NUM,SEQ_LINE,CHMP) values (100,6,'ORACLE IS GREAT');
Insert into RP06 (NUM,SEQ_LINE,CHMP) values (100,7,'AND /*4*/ ');
Insert into RP06 (NUM,SEQ_LINE,CHMP) values (100,8,'ORACLE IS GREAT');
Insert into RP06 (NUM,SEQ_LINE,CHMP) values (100,9,'OR ');
Insert into RP06 (NUM,SEQ_LINE,CHMP) values (100,10,'ORACLE IS GREAT');
Insert into RP06 (NUM,SEQ_LINE,CHMP) values (100,11,'AND ');
Insert into RP06 (NUM,SEQ_LINE,CHMP) values (100,12,'ORACLE IS GREAT');
Insert into RP06 (NUM,SEQ_LINE,CHMP) values (100,13,'OR ');
Insert into RP06 (NUM,SEQ_LINE,CHMP) values (100,14,'ORACLE IS GREAT');
Insert into RP06 (NUM,SEQ_LINE,CHMP) values (100,15,'OR ');
Insert into RP06 (NUM,SEQ_LINE,CHMP) values (100,16,'ORACLE IS GREAT');
Insert into RP06 (NUM,SEQ_LINE,CHMP) values (100,17,'AND ');
Insert into RP06 (NUM,SEQ_LINE,CHMP) values (100,18,'ORACLE IS GREAT');
Insert into RP06 (NUM,SEQ_LINE,CHMP) values (100,19,') ');
Insert into RP06 (NUM,SEQ_LINE,CHMP) values (100,20,'AND /*10*/ ');
Insert into RP06 (NUM,SEQ_LINE,CHMP) values (100,21,'ORACLE IS GREAT');
Insert into RP06 (NUM,SEQ_LINE,CHMP) values (100,22,'AND /*11*/ ');
Insert into RP06 (NUM,SEQ_LINE,CHMP) values (100,23,'ORACLE IS GREAT');after inserting the rows i want to retrieve the rows as follows
1 select the chmp which satisfied the condition if the chmp has previous row is 'AND'* and next row 'OR'* example: chmp with seq_line 4 which has previous 'AND' in seq_line 3 and 'OR' in seq_line 5. so retrieve the 4th seq_line chmp.
( CHMP WITH SEQ_LINE 8,12 ARE other EXAMPLES)
2) select the chmp which satisfied the condition if the chmp has previous row is *'OR' and next row 'AND'*
example: chmp with seq_line 10 which has previous 'OR' in seq_line 9 and 'AND' in seq_line 11. so retrieve the 10th seq_line chmp.
( CHMP WITH SEQ_LINE 6,16 ARE other EXAMPLES)
Kindly help
SHi,
You can use the analytic LAG function to get the value from the last row before a given row, and
you can use the analytic LEAD function to get the value from the next row after a given row.
For example:
WITH got_neighbors AS
SELECT num, seq_line, chmp
, LAG (chmp) OVER ( PARTITION BY num
ORDER BY seq_line
) AS prev_chmp
, LEAD (chmp) OVER ( PARTITION BY num
ORDER BY seq_line
) AS next_chmp
FROM rp06
-- WHERE ... -- Any filtering goes here
SELECT num, seq_line, chmp
FROM got_neighbors
WHERE prev_chmp LIKE 'AND %'
AND next_chmp LIKE 'OR %'
;I assume that your real table can have many values for num, and that when you talk about the "earlier" or "next" row, you mean a row with the same num. If that's not the case, then remove "PARTITION BY num".
Analytic functions are computed after the WHERE clause is applied, so to use the results of analytic functions in a WHERE clause, compute them first in a sub-query (such as got_neighbors), and then use them in the WHERE clause of a super-query. -
How to suppress a row based on current date - at query level?
In an Bex query report i have suppress rows based on current date.
There is no current date available in query.
there is a date field in the query.
If by chance the date in that field is lesser than current date, I have to suppress that row.
How can this be achieved?What is the code ofr creating a variable to get values >= to current date?
I have implemented the following code which is not working.
data L_S_range like line of E_T_range[].
CLEAR L_S_RANGE.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'GE'.
L_S_RANGE-LOW = SY-DATUM.
APPEND L_S_RANGE TO E_T_RANGE[].
Actually i have written in class, which will be inherited in superclass.
Edited by: akshara20 on Feb 2, 2011 1:21 PM -
Copy a certain row of data into the next row in a same internal table ??
HI, guys.
May i know how to copy a certain row of data into the next row in a same internal table ?? Bcz I plan to update a certain colum of data in the row just now into another value..
For example:-
*at first...
ebeln1 ebelp1 xblnr1
ebeln2 ebelp2 xblnr2
ebeln3 ebelp3 xblnr3
*after that, become...
ebeln1 ebelp1 xblnr1
ebeln2 ebelp2 xblnr2
ebeln2 ebelp2 xblnr4
ebeln2 ebelp2 xblnr5
ebeln3 ebelp3 xblnr3
Thanks in advance.hi,
If you have this kind of requirement then you must be having 2 internal tables ,one existing data and 2nd from which you have to insert the records into 1st table.
so in this case,
loop at itab1.
v_index = sy-tabix.
loop at itab2 into wa where pri_key = itab1-pri_key.
v_index = v_index + 1.
insert wa into itab index v_index.
endloop.
endloop.
Using this code ,your data records similar to your 1st tables primary key records will get inserted into table. -
How can I modify one column of current and next record depending of some criteria?
Having DDL
CREATE TABLE #ServiceChange(
[ID] [int] identity(1,1),
[SHCOMP] [char](2) NOT NULL,
[SHCRTD] [numeric](8, 0) NOT NULL,
[SHCUST] [numeric](7, 0) NOT NULL,
[SHDESC] [char](35) NOT NULL,
[SHTYPE] [char](1) NOT NULL,
[SHAMT] [numeric](9, 2) NOT NULL,
[CBLNAM] [char](30) NOT NULL,
[GROUPID] [char](2) NULL
And original and desire data in below link
https://www.dropbox.com/sh/bpapxquaae9aa13/AADnan31ZASublDjN7sa2Vvza
I would like to know how can I modify one column of current and next record depending of some criteria using SQL2012?
The criteria is:
Type should always flow F->T
if current abs(amount)> next abs(amount) then groupid = 'PD'
if current abs(amount)< next abs(amount) then groupid = 'PI'
there is no case when those amounts will be equals
where current(custid) = next(custid) and current(service) = next(service) and groupid is null
Any help will be really apreciated.
Thank youI tried that and got this error
'LAG' is not a recognized built-in function name.
You said you were using SQL 2012, but apparently you are not. The LAG function was added in SQL 2012. This solution works on SQL 2005 and SQL 2008:
; WITH numbering AS (
SELECT groupid,
rowno = row_number() OVER (PARTITION BY custid, service ORDER BY date, id)
FROM #ServiceChange
), CTE AS (
SELECT a.groupid,
CASE WHEN abs(a.amount) < abs(b.amount) THEN 'PD'
WHEN abs(a.amount) > abs(b.amount) THEN 'PI'
END AS newgroupid
FROM numbering a
JOIN numbering b ON b.custid = a.custid
AND b.service = a.service
AND b.rowno = a.rowno - 1
UPDATE CTE
SET groupid = newgroupid
Erland Sommarskog, SQL Server MVP, [email protected] -
No more "current and next month" list on left of iCal
Since the upgrade to Lion, the current and next month list on the left is gone. When I want to reschedule an event, I used to look on the left to see the dates in the next month, or current month if in week view etc .... now it's not there. If I want to change a date, I have to look at another calendar on my wall to reschedule. Can this list be put back on the left?
Mark,
You may want to experiment using the "Year" view. There is a keyboard shortcut (⌘4) for accessing that view.
Can this list be put back on the left?
Let Apple know about your suggestion using Apple - iCal - Feedback. -
Suppress COL and ROW based actual period and previous one
Hi!
Here is a problem I am trying to solve:
Lets say you have in COL a list of products and in ROW a list of client.
Most of the products bought by the client are the same month after month...
Most of the clients are the same month after month...
So I would like my COL to suppress depending on period N and period N-1 because my products hardly change. To add a new one, I will put the INSERT = Y in my expansion.
I would like my ROW to suppress depending on period N and period N-1 because in the long list of my clients, only some of them buy my products. To add new clients, I will put the INSERT = Y in my expansion.
I hope the definition of my problem above is good, here is how I try to solve it in my EVDRE;
PARAMETER EXPANSION 1 | EXPANSION 2
ExpandIn ROW | COL
Dimension Product | Client
MemberSet basmembers | basmembers
BeforeRange |
AfterRange |
Suppress [2009.JAN,2009.FEB ] | [2009.JAN,2009.FEB]
Insert y | y
It doesnt work!
When I have data in January, and I check February the expansion returns totaly empty!!
Thanks for your help
Nic
NB: I forgot to add that I am running SP3 v 5.0.502.03
Edited by: Nicolas Argente on Jul 16, 2008 4:22 PMFor your information, I also raised a ticket at SAP Support Portal from this problem. I will keep you updated with this problem.
Nic -
Select rows based on condition of same row
Hello,
I have the following table structure and rows defind here
http://sqlfiddle.com/#!4/3f474/3
I would like to select rows if PRODUCT_NO is null then I need to select rows which are having IS_PAYABLE='Y'. If PRODUCT_NO is not null
then IS_PAYABLE will be 'N' or IS_PAYABLE will be null.
E.g.
For PRODUCT_REG HPO_FABRIC, one PRODUCT_NO null so I need select that row only, not the other two rows.
I can do
select * from SUPPLIER_DETAILS where IS_PAYABLE='Y', but what if there are many records with PRODUCT_NO having null or not null
How can I do this using sql?This simple query!!!
select *
from supplier_details
where (product_no is null
and is_payable = 'Y')
or (product_no is not null and is_payable is null);
PRODUCT_REG PRODUCT_SUPPLIER_CODE PRODUCT_NO START_DATE END_DATE IS_PAYABLE
HPO_FABRIC JP_008 01-AUG-01 31-AUG-01 Y
HPO_FABRIC JP_008 STGA-FABR1 16-AUG-01 31-AUG-01 --Edited:- Modified Query and Results for 2nd Requirement
Edited by: Purvesh K on Sep 17, 2012 4:55 PM
--Removed NVL
Edited by: Purvesh K on Sep 17, 2012 5:04 PM -
Split a column based on even and odd rows
Table1
Table2
Col1
Odd
Even
A
A
B
B
C
D
C
E
F
D
G
H
E
I
NULL
F
G
H
I
I am using MS SQL v2005
I want to split a column into two columns : -
one column must have all the odd rows data while the other column must have even rows data
in other words I want the data in Table1 to be displayed as data in Table2.
Col, Odd and Even are column namesIn SQL 2005 wont approach like what I suggested do only a single scan of the table?
A major problem with your solution is that you assume that 1) the values are contiguous 2) they are numeric. Try the below:
CREATE TABLE #t (id INT NOT NULL IDENTITY(1,1), Col1 CHAR(1))
INSERT INTO #t VALUES ('A'),('B'), ('C'),('D'), ('E'),('F'), ('G'), ('H'), ('I')
go
SELECT MAX(CASE WHEN Col1 % 2 > 0 THEN Col1 END),
MAX(CASE WHEN Col1 % 2 = 0 THEN Col1 END)
FROM
SELECT Col1,ROW_NUMBER() OVER (PARTITION BY (Col1 % 2) ORDER BY Col1) AS Rn
FROM #t
)t
GROUP BY Rn
go
; WITH numbering AS (
SELECT Col1, row_number() OVER (ORDER BY Col1) AS rowno
FROM #t
), leading AS (
SELECT Col1 AS odd, LEAD(Col1) OVER(ORDER BY rowno) AS even, rowno
FROM numbering
SELECT odd, even
FROM leading
WHERE rowno % 2 = 1
go
DROP TABLE #t
Erland Sommarskog, SQL Server MVP, [email protected] -
Running sum current and previous row
Hi All, i want the result as showed in Final output column , can we achieve using anylatical function, plz provide me the solution only using SQL_
**Val YEAR MONTH MONTH_NO Final Out put**_
22 2001 OCT 10 22
24 2001 NOV 11 46
400 2001 DEC 12 446
405 2002 JAN 1 851
678 2002 FEB 2 1529
567 2002 MAR 3 2096
676 2002 APR 4 2772
67 2002 MAY 5 2839
76 2002 JUN 6 2915Try something like this:
SELECT val
, yr
, mnth
, mnth_no
, SUM(val) OVER (ORDER BY TO_DATE(yr||mnth, 'YYYYMON')) AS final_output
FROM table_x
;Note that year and month are reserved words so they aren't good column names. -
Creating View based on Current and previous data from same table
I am trying to create a view based on a table called “my_companies”. The table has following columns: “company_id”, “start_date”, “product_type_code”, “partner_id”
The main purpose of this view is to obtain previous company_id’s associated with a particular “partner_id“and “product_type_code”. So basically, I’m looking to create an extra column, say “prev_company_id” in the view along with all the other columns. The “previous” data can be obtained depending on the “start_date”. I’m not able to write a query successfully to do this.
Can anyone help? Thanks in advance.Hi,
Whenver you have a question, it helps to post:
(1) The version of Oracle (and any other relevant software) you're using
(2) A little sample data (just enough to show what the problem is) from all the relevant tables
(3) The results you want from that data
(4) Your best attempt so far
Executable SQL statements (like "CREATE TABLE AS ..." or "INSERT ..." statements) are best for (2).
Formatted tabular output is okay for (3). Type before and after the tabular text, to preserve spacing. The sample results should include any special cases that you foresee, such as one company having many previous companies, or vice-versa.
It sounds like might need a +self-join+, where you have two copies of the same table, as if the current companies were in one table and the previous companies were in another, even though they are all actually in the same table. -
Create row as next row on click of add another row button not on top of it
My af:table is based on a transientVO (all the attributes are transient)
This is just for data entry and not for data retrieval
So i have placed add another row button on my af:table
After i enter data in the first row and click add another row button the data is being moved to second row and the new row is created on top of that
I want the row to be created as next row . not on top of my existing row
How can we do thiswould this help you:
http://lucbors.blogspot.com/2010/12/adf-11g-how-to-control-where-new-row-is.html -
Linking image to image causes image to jump to the next row down.
I am doing a simple website.
I have images three across, edge to edge, on my index page.
When I add a link to any image, the one or two images following it in the row jump down to the next row down.Dear John,
Thanks for response.
I added your code as best I could but no difference.
The same thing is happening even when I hyperlink text.
All the best,
Clifford -
Row to column mapping and combining columns
Hi
I have one issue i want to concatenating some columns and map row as columns like below.I am giving one ex and have more than 1000 employees like this
Example
{Srno Eno Ename job datestart}
{1 01 jack------clerk------01-Jan-2008}
{ 2 01 jack-----snrclerk----01-Jun-2009}
{ 3 01 jack ---- officer------- 01-Jan-2010}
I want to display the row to columan mapping like first row concatenated as col2 and second row for col2 column etc
{eMpno------- col1 ------------------co12----------------------------------col3}
{0101 jackclerk 01-Jan-2008---jacksnrclerk01-Jun-2009------01jackofficer01-Jan-2010}
rgds
ramya
Edited by: user11243021 on Sep 7, 2010 5:21 AMwith t as (
select 1 srno,'01' eno,'jack' ename,'clerk' job,to_date('01-Jan-2008','dd-mon-yyyy') datestart from dual union all
select 2 srno,'01' eno,'jack' ename,'snrclerk' job,to_date('01-Jun-2009','dd-mon-yyyy') datestart from dual union all
select 3 srno,'01' eno,'jack' ename,'officer' job,to_date('01-Jan-2010','dd-mon-yyyy') datestart from dual
) -- end of data sample
select eno,
max(
case srno
when 1 then ename || ' ' || job || to_char(datestart,' dd-Mon-yyyy')
end
) col1,
max(
case srno
when 2 then ename || ' ' || job || to_char(datestart,' dd-Mon-yyyy')
end
) col2,
max(
case srno
when 3 then ename || ' ' || job || to_char(datestart,' dd-Mon-yyyy')
end
) col3
from t
group by eno
EN COL1 COL2 COL3
01 jack clerk 01-Jan-2008 jack snrclerk 01-Jun-2009 jack officer 01-Jan-2010
SQL> SY. -
No data found using APEX_APPLICATION and next pagination
Hi,
I have a problem with a report. I used :
one APEX_item.CHECKBOX(1,rownum)
one APEX_item.select_list_from_lov
two APEX_item.text
and a APEX_item.hidden
And I created a process to update data.
I have 171 rows in my report and 15 rows are displayed for each page.
My process work fine if i checked rows in my first page, but if I choose an item in my next 15 rows (with next pagination), I got a "no data found" error.
It looks like, Apex don't found the next 15 rows id.
I need your help to fix it.
tks a lot
BennHi all,
I have the same problem with another report, here is part of my code :
DECLARE
q VARCHAR2 (30000);
tbl VARCHAR2 (30000);
w varchar2(500);
n varchar2(3);
BEGIN
q := ' select APEX_ITEM.CHECKBOX(14,rownum) id,x.Nom,' ||
'APEX_ITEM.SELECT_LIST_FROM_LOV(11,x.IdHoraire,''' ||
'LISTE DES HORAIRES DE TRAVAIL' || ''',null,''' || 'NO' || ''') as Horaire,' ||
'APEX_ITEM.CHECKBOX(12,x.TechAccredite,' ||
'decode(x.TechAccredite,null,null,' || '''CHECKED''' || ')) Accredite, ' ||
'APEX_ITEM.TEXT(13,x.Numero,10,10,' ||
'''onblur="javascript:if(!valider_telephone(1,this.value)){alert(''' ||
'''Numero non valide''' || '''); this.focus();};"''' || ') Tel, ' ||
'APEX_ITEM.HIDDEN(10,x.IdCT) as ICT';
q := q || ' from (';
tbl := ' a valide select statement';
q := q || tbl || ' ) x ';
w := ' where ';
w := w || ' x.IdDepot = decode(:P97_IDDEPOT,-1,x.IdDepot,:P97_IDDEPOT) ';
w := w || ' or x.IdDepot is null ';
w:= w || ' order by 2';
q := q || w;
RETURN q;
END;
and I created a process :
declare
res varchar2(100);
id number;
Begin
res := 'res';
for i in 1..APEX_APPLICATION.G_F14.count loop
id := to_number(APEX_APPLICATION.G_F14(i));
res := res || ' i=' || i || ' rownum ' || id || ' th ' ||
APEX_APPLICATION.G_F11(APEX_APPLICATION.G_F14(i));
end loop;
:P97_POUB := res;
End;
My process just print the 'res' in an item named P97_POUB, so I can see if evry thing works.
But I still have a no data found error.
Benn
Maybe you are looking for
-
How to find out if a role is deleted
Hi security experts, We are trying to find out the way to identify the role(s) that have been deleted within a certain time interval. In which table is this information stored? Actually we are interested in getting to know the roles without profile a
-
Login with oracle.jbo.DMLException ??
dear all, I use oracle jdeveloper 11g 2 release and oracle 10g db. my db connection name is myDataSourceDS. And also weblogic server data source name also myDataSourceDS. but earlier my db connection name is ' ConLibr '. but after i change it accordi
-
Sync iphone with ical, sync iphone with ical
How do i sync my iPhone with iCal on my Mac? FYI I DO NOT want to use iCloud because MobileMe NEVER worked right for me.
-
Photoshop cs5 hangs on launch when loading brushes
Photoshop cs5 hangs on launch when loading brushes. I have to do a hard reboot and reset the preferences. In the past 2 days I have had to do this 3 times. I have the latest drivers. below is my hardware. I am also running lightroom. I did not
-
PhotoShop CS6 - Lighting Effects Not showing
I know the question sounds like the ones you get all the time but in PhotoShop cs6 I can access the filter>render>lighting effects but when I click the lighting effect tab nothing shows and when I watch a tutorial and people open filter>render>lighti