Filter a column and a row based on two labels
Hi
Having a slight problem with an excel table and how to either filter or lookup the value I require.
Basically the table is a skill matrix that I am trying to create into an app. The columns of the table are Name, and then all the separate areas (Area 1, Area 2, Area 3 etc). The rows are then the persons name in the name column and then a grading of that
persons skills for each area. So the table looks look this:
Name. Area 1. Area 2. Area 3.
John. 1. 1. 3
Paul. 2. 1. 1
I have created a gallery with all the names, and another gallery with all the areas - and I would like the values for the areas to show based on these 2 criteria. Tried Lookup which kept throwing up errors and also filter which again threw up errors. Is
there any way to combine these to get the values showing in a label?
Thanks
Thanks. I tried that method and it works but I have too many areas to make it functional within the app experience.
A bit more information:
I have a gallery which is linked to Table 1 - this consists of the name of each person and an image - the image is what controls the gallery, touch it and you go to screen 2 which is that person's individual 'page'.
On this page is the persons image, a label with their name, a drop down box and a text gallery. The drop down box and text gallery are linked to Table 2 - The dropdown is directed by a column in the table which is Zones and the text gallery is filtered by
these zones into the areas within the zones:
Zones Areas Name1 Name2
Name3 ....
Zone 1 Area 1 3
2 3
Zone 1 Area 2 1
3 2
Zone 2 Area 3 3
3 3
Zone 3 Area 4 1
1 3
(This is an example of the table - the areas actually go into close to 100 and split into 6 zones).
The Text gallery filter works upto a point - it gives me a Header which is based on the correct area - and only shows the Areas for the Zone picked from the drop down box. However, I would like the Body of the text gallery to give me the number for the name
(which is the same name as picked from gallery 1).
This is where I am having major problems (spent a week on this upto now and its nearly cost me 2 tablets when I think i have solved it and that little yellow triangle pops up in the body box).
I have tried Lookup on Table2, using the name from gallery 1 as a the argument but it asks me each time to pick the right column to look in, which would work if I wanted the gallery only to work for a single Name but I would like it to show the rankings
for the person who is picked from gallery1.
Similar Messages
-
Dynamic gallery with 3 columns and 5 rows with paging
guyz, i am new to spry and i need your help. i want to create
a dynamic gallery with data source as xml. i want to create a
gallery with 3 columns and 5 rows.Basically a wallpaper page where
there would be 15 wallpapers in a page with a link of downloading
wallpapers with resolution 800x600,1024x768 and 1280x1024.
for example if there are 63 wallpapers for a section , then
there would be 5 pages with 5th page having only 3 wallpapers.
everytime a wallpaper is added to xml, it automatically adds
it up in html...
plz help....i really want to create this asap and i cant find
any help...thanks a ton for your response.... Meanwhile i figured out
the solution myself using photogallery tutorial where div fixes the
width and the next repeated element get shifted to another
line.....
now i am struck with another problem.
i need to give substring to a particular data on xml.
for example i have the following xml
<movies>
<data>
Important Note: These online forums are for user-to-user
discussions of Adobe products, and are not an official customer
support channel for Adobe. If you require direct assistance, or
prefer to contact Adobe support staff directly, please contact
Adobe support.
</data>
</movies>
i want to display only first 50 characters of data tag.....
whats the code/syntax to do so..... -
How can I create 25 charts on a page, each chart 2 columns and 10 rows
I need to create a chart that has 25 tables. 5 tables in 5 columns. Each table has 2 columns and 10 rows. I know it can fit all on 1 page as I have seen it done but I can not figure out how
I had some initial difficulty understanding your question. In Numbers, a "chart" is a graph.
You want to create a 5 x 5 array of tables, each with two columns and 10 rows, placed on a single page.
At the default size, each cell on a new Table is 1 inch wide and 0.2 inches high. So without displaying a title, each of your 25 charts would occupy a two inch square space.
Butted closely together, that's a space that is 10 inches wide by 10 inches high.
On a machine set to US localization,the default page size is US Letter, placed in Landscape orientation. Left, right and top margins are set to 0.75", bottom margin is 0.5", and there is a 0.25" height reserved for page header and page footer.
That leaves a working space that's 9.5" wide and 6.75" high.
Obviously, some adjustments will be needed.
0.2" is pretty much the minimum for row height. You can go smaller by typing in a smaller height in the Table Inspector, but even with 9 point type, you begin to lose the descenders on ps and qs. Go with 0.2, then use the slider in Print view to further shrink the content.
If you can narrow the columns significantly (to 0.75" or less), then go to Page setup and change to Portrait orientation.
In the Sheet Inspector, decrease all margins to 0.5", and the header and footer spaces to 0. Set page orientation to Portrait.
Now consider the Table(s). If you've opened a new, blank document, you'll have a multi column, multi row table with one header row and one header column. If you don't need the header row and header column, delete them (column A, Row 1) right away.
Reduce the number of rows to 10 and the number of columns to 2. Select the whole table and, in the Table inspector, set the row height to 0.16" and the row width to 0.73".
With the table still selected. press command-D four times to create four duplicate tables.
Go View > Show Rulers, then View > Show Print View. go back to the Table Inspector and use the slider to set Content Scale to about 94%.
Drag the still selected Table to the right margin of the page. Press command-A to Select All.
Go Arrange > Align > Top
Go Arrange > Distribute Space > Horizontal.
With all five tables still selected, press command-D to duplicate the set.
Hold down the Shift key and press the left arrow once, then the down arrow 14 times. This should bring the new row of tables into line with the previous ones, and move them down the page to just below the first row of tables. If fine adjustment is needed, use the arrow keys with the shift key released.
Repeat three more times to add another three rows of tables.
Adjust the spacing between tables as necessary.
Regards,
Barry -
How can I select and delete rows based on the value in one column?
I searched through the discussion board, and found a thread on deleting blank rows, but not sure how to modify it to work with my issue.
I have put together a rather complicated spreadsheet for designing control systems, it calculates parts needed based on check boxes selected in a second spreadsheet.
Since not all systems require all parts there are many rows that have a 0 quantity value, I would like to select these rows and delete them once I have gone through the design phase (checking off required features on a separate sheet).
I like the way the other thread I found will gather all the blank rows at the bottom without changing the order of the rows with data in them.
I don't understand exactly how the formula in the other thread works well enough to modify it to look for a certain column.
I hope I made myself clear enough here, to recap, I would like to sort the rows based on a zero value in one (quantity) column, move them (the zero quantity rows) to the bottom of the sheet, and then delete the rows with a zero quantity (I can delete them manually, but would like to automate the sorting part).
Thanks for any help anyone can provide here.
DannyI apologize but, as far as I know, Numbers wasn't designed by Ian Flemming.
There is no "this column will be auto-destructing after two minutes"
You will have to use your fingers to delete it.
I wish to add a last comment :
if your boss has the bad habit to look over your shoulder, it's time to find an other one.
As I am really pig headed, it's what I did. I became my own boss so nobody looked over my shoulder.
Yvan KOENIG (VALLAURIS, France) mercredi 13 juillet 2011 20:30:25
iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8
Please : Search for questions similar to your own before submitting them to the community
To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer ! -
Unique row based on two columns and single column
Dear Members,
I have a table which contains duplicate rows, for which a query should be able to fetch the unique row from the table. Here the unique is not based on one column, but it should be on two columns and also check for uniqueness on one column.
create table addr ( firstname varchar2(10), lastname varchar2(10), area varchar2(3));
insert into addr values('bob', 'james', '1');
insert into addr values('bob', 'james', '1');
insert into addr values('harry', 'bert', '1');
insert into addr values('jimmy', 'bert', '1');
insert into addr values('sam', 'mac', '1');
insert into addr values('sam', 'knight', '1');
insert into addr values('tom', 'sand', '1');
insert into addr values('cat', 'mud', '1');
The output of query should contain 3 rows.
bob - james
harry - bert or jimmy - bert [ either one of them, but not both ]
sam - mac or sam - knight [ either one of them, but not both ]
tom - sand
cat - mud
SELECT firstname, lastname as total from addr WHERE area = '1' GROUP by firstname,lastname; This does not take of single column duplication..
Any suggestions..SQL> with t_data
as
select 'bob' as firstname, 'james' as lastname, '1' as area from dual union all
select 'bob', 'james', '1' from dual union all
select 'harry', 'bert', '1' from dual union all
select 'jimmy', 'bert', '1' from dual union all
select 'sam', 'mac', '1' from dual union all
select 'sam', 'knight', '1' from dual union all
select 'tom', 'sand', '1' from dual union all
select 'cat', 'mud', '1' from dual
SELECT
firstname,
lastname,
area
FROM
SELECT
t.*,
row_number() over(partition BY firstname order by 1) rn,
row_number() over(partition BY lastname order by 1) rn1
FROM
t_data t
WHERE
rn = 1
AND rn1 =1 ;
FIRSTNAME LASTNAME AREA
bob james 1
cat mud 1
jimmy bert 1
sam knight 1
tom sand 1
SQL> -
Cursor and Update rows based on value/date
SQL Server 2012
Microsoft SQL Server Management Studio
11.0.3128.0
Microsoft Analysis Services Client Tools
11.0.3128.0
Microsoft Data Access Components (MDAC)
6.1.7601.17514
Microsoft MSXML 3.0 4.0 5.0 6.0
Microsoft Internet Explorer
9.11.9600.16518
Microsoft .NET Framework
4.0.30319.18408
Operating System
6.1.7601
The objective of this is to test the Cursor and use it on a production environment after this is fixed. What I would like to do is update rows in a column i duplicated originally called 'HiredDate' from AdventureWorks2012 HumanResources.Employee table. I
made a duplicate column called 'DateToChange' and would like to change it based on a date I have picked, which returns normally 2 results (i.e. date is '04/07/2003'). The code runs but will not change both dates. It did run however with an error but changed
only 1 of the 2 rows because it said ['nothing available in next fetch'].
The code to add the columns and perform the query to get the results I am running this against:
-- ADD column 'DateToChange'
ALTER TABLE [HumanResources].[Employee] ADD DateToChange Date NOT NULL;
-- Copy 'HireDate' data to 'DateToChange'
UPDATE HumanResources.Employee SET DateToChange = HireDate;
-- Change 'DateToChange' to NOT NULL
ALTER TABLE [HumanResources].[Employee] ALTER COLUMN DateToChange Date NOT NULL;
SELECT BusinessEntityID,HireDate, CONVERT( char(10),[DateToChange],101) AS [Formatted Hire Date]
FROM HumanResources.Employee
WHERE [DateToChange] = '04/07/2003';
Code:
USE AdventureWorks2012;
GO
-- Holds output of the CURSOR
DECLARE @EmployeeID INT
DECLARE @HiredDate DATETIME
DECLARE @HiredModified DATETIME
DECLARE @ChangeDateTo DATETIME
--Declare cursor
-- SCROLL CURSOR ALLOWS "for extra options" to pul multiple records: i.e. PRIOR, ABSOLUTE ##, RELATIVE ##
DECLARE TestCursor CURSOR SCROLL FOR
-- SELECT statement of what records going to be used by CURSOR
-- Assign the query to the cursor.
SELECT /*HumanResources.Employee.BusinessEntityID, HumanResources.Employee.HireDate,*/ CONVERT( char(10),[DateToChange],101) AS [Formatted Hire Date]
FROM HumanResources.Employee
WHERE DateToChange = '01/01/1901'
/*ORDER BY HireDate DESC*/ FOR UPDATE OF [DateToChange];
-- Initiate CURSOR and load records
OPEN TestCursor
-- Get first row from query
FETCH NEXT FROM TestCursor
INTO @HiredModified
-- Logic to tell the Cursor while "@@FETCH_STATUS" 0 the cursor has successfully fetched the next record.
WHILE (@@FETCH_STATUS = 0 AND @@CURSOR_ROWS = -1)
BEGIN
FETCH NEXT FROM TestCursor
IF (@HiredModified = '04/07/2003')/*05/18/2006*/
-- Sets @HiredModifiedDate data to use for the change
SELECT @ChangeDateTo = '01/01/1901'
UPDATE HumanResources.Employee
SET [DateToChange] = @ChangeDateTo --'01/01/1901'
FROM HumanResources.Employee
WHERE CURRENT OF TestCursor;
END
-- CLOSE CURSOR
CLOSE TestCursor;
-- Remove any references held by cursor
DEALLOCATE TestCursor;
GO
This query is run successfully but it does not produce the desired results to change the dates
04/07/2003 to 01/01/1901.
I would like the query to essentially be able to run the initial select statement, and then update and iterate through the returned results while replacing the necessary column in each row.
I am also open to changes or a different design all together.
For this query I need:
1. To narrow the initial set of information
2. Check if the information returned, in particular a date, is before [i.e. this current month minus 12 months or
12 months before current month]
3. Next replace the dates with the needed date
[Haven't written this out yet but it will need to be done]
4. After all this is done I will then need to update a column on each row:
if the 'date' is within 12 months to 12 months from the date checked
NOTE: I am new to TSQL and have only been doing this for a few days, but I will understand or read up on what is explained if given enough information. Thank you in advance for anyone who may be able to help.The first thing you need to do is forget about cursors. Those are rarely needed. Instead you need to learn the basics of the tsql language and how to work with data in sets. For starters, your looping logic is incorrect. You open
the cursur and immediately fetch the first row. You enter the loop and the first thing in the loop does what? Fetches another row. That means you have "lost" the values from the first row fetched. You also do not test the success of
that fetch but immediately try to use the fetched value. In addition, your cursor includes the condition "DateToChange = '01/01/1901' " - by extension you only select rows where HireDate is Jan 1 1901. So the value fetched into @HiredModified will
never be anything different - it will always be Jan 1 1901. The IF logic inside your loop will always evaluate to FALSE.
But forget all that. In words, tell us what you are trying to do. It seems that you intend to add a new column to a table - one that is not null (ultimately) and is set to a particular value based on some criteria. Since you intend the
column to be not null, it is simpler to just add the column as not null with a default. Because you are adding the column, the assumption is that you need to set the appropriate value for EVERY row in the table so the actual default value can be anything.
Given the bogosity of the 1/1/1901 value, why not use this as your default and then set the column based on the Hiredate afterwards. Simply follow the alter table statement with an update statement. I don't really understand what your logic
or goal is, but perhaps that will come with a better description. In short:
alter table xxx add DateToChange date default '19010101'
update xxx set DateToChange = HireDate where [some unclear condition]
Lastly, you should consider wrapping everything you do in a transaction so that you recover from any errors. In a production system, you should consider making a backup immediately before you do anything - strongly consider and have a good reason not
to do so if that is your choice (and have a recovery plan just in case). -
Advanced datagrid with grouped columns and grouped rows
hello every body, plz need your experience help. 'cause Im so new using FLEX
I have an XML (like an XML data type) something like this
<Table>
<Rows>
<cAgencia>F0002</cAgencia>
<cAgNombre>SanBorja</cAgNombre>
<cTVentanilla>V0002</cTVentanilla>
<dTVNombre>Plataforma</dTVNombre>
<TcksEnEspera>20</TcksEnEspera>
<VentsEnAtencion>50</VentsEnAtencion>
</Rows>
<Rows>
<cAgencia>F0003</cAgencia>
<cAgNombre>Miraflores</cAgNombre>
<cTVentanilla>V0002</cTVentanilla>
<dTVNombre>Plataforma</dTVNombre>
<TcksEnEspera>30</TcksEnEspera>
<VentsEnAtencion>40</VentsEnAtencion>
</Rows>
<Rows>
<cAgencia>F0002</cAgencia>
<cAgNombre>SanBorja</cAgNombre>
<cTVentanilla>V0003</cTVentanilla>
<dTVNombre>Caja</dTVNombre>
<TcksEnEspera>55</TcksEnEspera>
<VentsEnAtencion>25</VentsEnAtencion>
</Rows>
...... (continue)
</Table>
so, I need to make a table (I guess with advancedDataGrid) something like this
as you can see, I have to group them by columns and Rows. I have found a "mx:groupedColumns" that maybe could help me , but I couldn't find something like "mx:groupedRows".
The grid may be dynamic, for example if I have another XML node like:
<Rows>
<cAgencia>F0004</cAgencia>
<cAgNombre>SanMiguel</cAgNombre>
<cTVentanilla>V0002</cTVentanilla>
<dTVNombre>Plataforma</dTVNombre>
<TcksEnEspera>15</TcksEnEspera>
<VentsEnAtencion>52</VentsEnAtencion>
</Rows>
the grid may add a ROW and in the column of plataforma add the data: 15 and 52, so the grid may be something like this:
as you can see, the grid may add rows and columns in depends of the count of XML data.
plz help.
thanks, regards from Lima, Peru.
JSany help ????????? I found OLAPDataGrid ..... I was thinking to send all the data into a bidimensional Array , then pass the data of my bidimensionalArray to OLAPDataGrid ... but I'n not sure if Flex is able to do it ....
the really serious problem is the special ROW I must use ...
regards
JS -
Update multiple rows based on two columns in same row
I have a 1000 rows in a table I would like to update with a unique value. This unique value is a cocatenation of two columns in teh same row.
Each row has a (i) date and a (ii) time and a (iii) date_time column. I would like to update the date_time (iii) column with a cocatenation of the (i) date and (ii) time columns.
I know how I would update a single row but how can I update multiple rows with a cocatenation of each of the two columns - i.e put a different value into the date_time column for each row?this?
update table tab_name
set date_time =date||time
where your_condition -
Link column and fetch row...
Hello!
I have a report with 5 columns. I am trying to create a link in one of the columns of the report . I want to select the link and redirect to a form which would edit the row of another table based on the link. I managed to create a link to the form i want but the form is empty...I can't fetch the primary key's value and the values of the other fields of the form.The primary key of the form is the link column. I hope that the problem is clear enough.
Thanx in advance for any answers.I set the target of the link to another page in the application where i have the form i want to fill....
No, i don;t have any other process. My problem is that i want to automatically fill the form using as primary key the link column but i really don't have any idea what should i do,cause i am a starter. I would appreciate any help. -
JTable - programmatically setting the left column and top row
I have a JTable in a JScrollPane. I would like to be able to programmatically scroll the table so that a certain column is shown as the left most column in the table, and/or a certain row is shown as the first visible row in the table.
This is to allow a user to enter a value for the column or row that the want to be on the left or top of the viewport (ie, it is up to the user how they want to move the initially see the table).
Any help would be much appreciated,
Cheers, SeanHere is one way to do it:
1) use the getCellRect(row,column,false) to get a rectangle for the cell you wish to display in the upper left corner
2) use the getVisibleRect() method to get the viewport
3) set the viewport x and y coordinate to be the same as the cell x,y coordinate
4) use the scrollRectToVisible method to scroll to the desired area
For example:
Rectangle cellRect=myTable.getCellRect(5,10,false);
Rectangle vis=myTable.getVisibleRect();
vis.x=cellRect.x;
vis.y=cellRect.y;
myTable.scrollRectToVisible(vis);
Caveat: posted code has not been tested!
;o)
V.V. -
How to split rows based on two columns..
Hi all...
I have a requirement.
I have product column, sell, purchace prices..(total of three columns) in a data set.
my data set is such a way that..if sale price exists...there is no purchase price and vice versa..
I need too present in a report ,two tables:
table 1 consists of only Sale price items
table 2 should contain only Pruchase Items.
Please see the below picture for clear understanding..
Is that doable? Where do we need to impose a condition?I tried to impose a condition but,it didnt seem to work
http://i51.tinypic.com/29xfdc6.jpg
Please help.Can you send me the template and xml file to [email protected]? I can try to help.
Did you try to filter out the records by the sale price or purchase price column not equal to null?
Thanks,
Bipuser -
RAS - CrossTabObject - Total Column and Total Row -ITextObject
CRVS2010 ; RAS dlls 13.0.1.200
I need to provide internationalization and localization for what visual studio reports are ITextObject(s) in the rightmost column header and also the bottom row which have the text "Total". I can get to the CrossTab object but find no property on it or CrossTab.Format that exposes the targeted text. I also did not find a place to set this text in the designer - "Chart Expert".
Is that the end of story or can you help me find the path through the object model ? Thanks so muchHi Doyle,
Correct on Crosstab objects, all you can do is change their size and position. work around is to create a manual crosstab report. None of our report engines could ever do anything with the parts themselves.
As for charting, search, someone asked that the other day so it's its a recent post and I posted sample code which he expanded on.
Don -
How to Make FUNCTION to return multiple column and multiple row output
Hi All,
Kindly Share ur Idea;Thanks in Advance;
i Have Table Demo.
table DEMO:
id name
1 a10
1 a11
1 a12
2 b10
2 b11
3 ccc
and the function is like:
create or replace function (p1 number) return varchar2 as
vid number;
vname varchar2(20);
begin
select id,name into vid,vname from demo where id=p1;
return v1;
end;
this function returns output for id=3;
BUT,
i need output as (for input as 1)
vid vname
1 a10
1 a11
1 a12A function returns a single datatype.
That datatype may be an atomic datatype (varchar2, number etc.) or it may be an object/record datatype, or even a collection datatype.
Where are you going to use this function? In PL/SQL or SQL?
If you are wanting to use it in SQL, then you would need a pipelined function e.g.
SQL> CREATE OR REPLACE TYPE myemp AS OBJECT
2 ( empno number,
3 ename varchar2(10),
4 job varchar2(10),
5 mgr number,
6 hiredate date,
7 sal number,
8 comm number,
9 deptno number
10 )
11 /
Type created.
SQL> CREATE OR REPLACE TYPE myrectable AS TABLE OF myemp
2 /
Type created.
SQL> CREATE OR REPLACE FUNCTION pipedata(p_min_row number, p_max_row number) RETURN myrectable PIPELINED IS
2 v_obj myemp := myemp(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
3 BEGIN
4 FOR e IN (select *
5 from (
6 select e.*
7 ,rownum rn
8 from (select * from emp order by empno) e
9 )
10 where rn between p_min_row and p_max_row)
11 LOOP
12 v_obj.empno := e.empno;
13 v_obj.ename := e.ename;
14 v_obj.job := e.job;
15 v_obj.mgr := e.mgr;
16 v_obj.hiredate := e.hiredate;
17 v_obj.sal := e.sal;
18 v_obj.comm := e.comm;
19 v_obj.deptno := e.deptno;
20 PIPE ROW (v_obj);
21 END LOOP;
22 RETURN;
23 END;
24 /
Function created.
SQL> select * from table(pipedata(1,5));
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7369 SMITH CLERK 7902 17-DEC-1980 00:00:00 800 20
7499 ALLEN SALESMAN 7698 20-FEB-1981 00:00:00 1600 300 30
7521 WARD SALESMAN 7698 22-FEB-1981 00:00:00 1250 500 30
7566 JONES MANAGER 7839 02-APR-1981 00:00:00 2975 20
7654 MARTIN SALESMAN 7698 28-SEP-1981 00:00:00 1250 1400 30
SQL> select * from table(pipedata(6,10));
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7698 BLAKE MANAGER 7839 01-MAY-1981 00:00:00 2850 30
7782 CLARK MANAGER 7839 09-JUN-1981 00:00:00 2450 10
7788 SCOTT ANALYST 7566 19-APR-1987 00:00:00 3000 20
7839 KING PRESIDENT 17-NOV-1981 00:00:00 5000 10
7844 TURNER SALESMAN 7698 08-SEP-1981 00:00:00 1500 0 30
SQL> select * from table(pipedata(11,15));
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7876 ADAMS CLERK 7788 23-MAY-1987 00:00:00 1100 20
7900 JAMES CLERK 7698 03-DEC-1981 00:00:00 950 30
7902 FORD ANALYST 7566 03-DEC-1981 00:00:00 3000 20
7934 MILLER CLERK 7782 23-JAN-1982 00:00:00 1300 10
SQL>If you are using it in PL/SQL then just populating a collection datatype and returning that will do. Though you should question why you want to pass large amounts of data around like that first.
Explain your purpose and what you are intending to do and we can recommend the best way.
{message:id=9360002} -
ITunes "show" column and front row!
http://web.mac.com/chris.ducasse/iWeb/Site/Blog/0F986FFC-A041-4503-8C76-CA851F27 DE6A.html
that is a link to what I am talking about. I really need help here, Front Row will not see these items unless this column is filled out for the particular track
PLEASE HELP!
Thank you in advance for any assistance!You can change the tags of mp4s, using Lostify
Hope this helps.
M -
How to get value in previous column and another row from Matrix with Custom Code?
I want to calculate the value of tb_Open and tb_Close. I try to use custom code for calculate them. tb_close is correct but tb_Open is not correct that show value = 0 .
This is example report:
* I have 2 Dataset , Dataset1 is all data for show in my report. Dataset2 is only first Open for first month
* First value of Open is item field in Dataset2 and this value only for first month (january). But for other month Open value get from Close in previous month.
Detail for Red number:
1. tb_Open -> tb_Close in previous month but first month from item field in Dataset2
expression =FormatNumber(Code.GetOpening(Fields!month.Value,First(Fields!open.Value, "Dataset2")))
2. tb_TOTAL1 group on item_part = 1
expression =FormatNumber(Sum(CDbl(Fields!budget.Value)))
3. tb_TOTAL2 group on item_part = 3 or item_part = 4
expression =FormatNumber(Sum(CDbl(Fields!budget.Value)) + ReportItems!tb_TOTAL1.Value )
4. tb_TOTAL3 group on item_part = 2
expression =FormatNumber(Sum(CDbl(Fields!budget.Value)) - ReportItems!tb_TOTAL2 .Value)
5. tb_Close -> calculate from tb_TOTAL3 - tb_Open
expression =FormatNumber(Code.GetClosing(ReportItems!tb_TOTAL3.Value,ReportItems!tb_Open.Value))
My custom code:
Dim Shared prev_close As Double
Dim Shared now_close As Double
Dim Shared now_open As Double
Public Function GetClosing(TOTAL3 as Double,NowOpening as Double)
now_close = TOTAL3 + NowOpening
prev_close = now_close
Return now_close
End Function
Public Function GetOpening(Month as String,NowOpen as Double)
If Month = "1" Then
now_open = NowOpen
Else
now_open = prev_close
End If
Return now_open
End Function
Thanks alot for your help!
Regards
Panda ALooks okay to me.
Perhaps the variables should be declared as public (?)
Maybe you are looking for
-
Mac book Pro and Intel Iris Graphics 6100 compatible with Adobe CC?
Hi, I want to buy 13 inch Macbook pro (http://store.apple.com/us/buy-mac/macbook-pro?product=MF840LL/A&step=config#) just wanted to ask if it's graphic card (Intel Iris Graphics 6100) is compatible with Adobe Creative Cloud program like Illustrator,
-
Playing a .swf on a PC?
My client is trying to play a .swf file (outside of a browser) on his PC. He has Flash Player 10 installed, but the player doesn't seem to recognize the file. I can play this file on a Mac with no problems. Any suggestions would be greatly appreciate
-
To restart listener in Redhat 5
Hi, I have created a new listener in oralce 10g on Redhat 5 plateform, and created a service name. How can I can i restart the listener service to take changes effect. I did'nt find the oracle listener in services in Redhat 5 as we get in windows. Th
-
Service Registry - Services without documentation
Hi all, how can i add a documentation to my services in the service registry? Documentation URL: There is no documentation URL available regards
-
How to get line number in JAVA code?
Hi, What method can I use to return the current line number of my coding? Assuming I'm at line 10 and I want to do something like System.out.println("I am at line number " + ????);What method should I use to get "10"? Please advise. Thank you.