Help query column
i am connecting on a database via flash remoting, and i'd
like to get the result of my query.
on the clientside, my code is:
trace(result.items[0].F1_1)
this will return first item on the query with column name of
F1_1
however, i have a lot of columns returned and column names
are named like F1_1, F1_2 ... F12_1, F12_12.... and so on and i'd
like to get/trace the value of each column. My alternate solution
to cut/save coding space is to do a loop:
for(ctr1=1;ctr1<13;ctr1++){
for(ctr2=1;ctr2<13;ctr2++){
trace(this["result.items[0].F"+ctr1+"_"+ctr2])
however the loop code returns undefined.
any suggestion on how i am going to loop and return the value
of the column names?
try:
Similar Messages
-
Aggregates in Query Columns of a Web Database
What Aggregates expressions are not allowed in Query Columns context of a web database
Hi,
As this post is more related to SQL, I suggest you post a question in SQL forum.
More experts will help you find the solution and you will get more information from there.
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/home?category=sqlserver
Best regards,
Zhengyu Guo
Zhengyu Guo
TechNet Community Support -
BEx Query Columns come back in different Order after drill?
I have a strange effect when I work with BEx Queries in Xcelsius.
On default, I open and display the Bex Query "A". Columns are in order like defined in BEx Designer (Column1, Column2, Column3.....)
I want to do a drill, and so in Xcelsius BEx Connection settings I set the Filter on Field "X" in the XLS and in "Query Usage" I addionally apply the setting "Refresh when Trigger Cell "X" changes".
Starting the report works fine. But when I do the drill and the Query refreshes, the BEx Query Columns come back in different order?!?
It looks as if Column 2 and Column 3 are exchanged.
How can I fix that?
Thx,
B. WegnerAfter some testing....
This issue is independent from the filter value. But it only seems to occure when a second BEx Query connection is defined.
The BEx Query Data Columns come back in different order after
- Refresh on Trigger
- Refresh after XY Seconds
Any Ideas?
Edited by: B.Wegner on Nov 16, 2010 3:42 PM -
Query help: query to return column that represents multiple rows
I have a table with a name and location column. The same name can occur multiple times with any arbitrary location, i.e. duplicates are allowed.
I need a query to find all names that occur in both of two separate locations.
For example,
bob usa
bob mexico
dot mexico
dot europe
hal usa
hal europe
sal usa
sal mexico
The query in question, if given the locations usa and mexico, would return bob and sal.
Thanks for any help or advice,
-=beekyHow about this?
SELECT NAME
FROM <LOCATIONS_TABLE>
WHERE LOCATION IN ('usa','mexico')
GROUP BY NAME
HAVING COUNT(DISTINCT LOCATION) >= 2Results:
SQL> WITH person_locations AS
2 (
3 SELECT 'bob' AS NAME, 'USA' AS LOCATION FROM DUAL UNION ALL
4 SELECT 'bob' AS NAME, 'Mexico' AS LOCATION FROM DUAL UNION ALL
5 SELECT 'dot' AS NAME, 'Mexico' AS LOCATION FROM DUAL UNION ALL
6 SELECT 'dot' AS NAME, 'Europe' AS LOCATION FROM DUAL UNION ALL
7 SELECT 'hal' AS NAME, 'USA' AS LOCATION FROM DUAL UNION ALL
8 SELECT 'hal' AS NAME, 'Europe' AS LOCATION FROM DUAL UNION ALL
9 SELECT 'sal' AS NAME, 'USA' AS LOCATION FROM DUAL UNION ALL
10 SELECT 'sal' AS NAME, 'Mexico' AS LOCATION FROM DUAL
11 )
12 SELECT NAME
13 FROM person_locations
14 WHERE LOCATION IN ('USA','Mexico')
15 GROUP BY NAME
16 HAVING COUNT(DISTINCT LOCATION) >= 2
17 /
NAM
bob
salHTH!
Edited by: Centinul on Oct 15, 2009 2:25 PM
Added sample results. -
Need help for the query columns to rows
Hi everyone,
I have two tables TABLE1 and TABLE2; TABLE1 is Master table,TABLE2 is child table.
The key for TABLE1 is C1 column
The key for TABLE2 is C1,C_MONTH Columns
The sample data is as follows
TABLE1
======
C1 C2
1 A
2 B
3 C
4 D
TABLE2
======
C1 C_MONTH C3
1 JAN AAA
1 FEB BBB
1 MAR CCC
1 APR DDD
2 JAN ZZZ
2 FEB YYY
2 MAR XXX
2 APR UUU
I want to display the data as follows
1 A JAN AAA FEB BBB MAR CCC APR DDD
2 B JAN ZZZ FEB YYY MAR XXX APR UUU
Can any one help me how to write this query?
Thanks in advance[email protected] wrote:
Thanks for the update
but I want the out put as column values rather than one column as follows
C1 C2 J_MONTH J_VALUE F_MONTH F_VALUE M_MONTH M_VALUE A_MONTH A_VALUE
1 A JAN AAA FEB BBB MAR CCC APR DDD
2 B JAN ZZZ FEB YYY MAR XXX APR UUUThis is a standard pivot.
In 10g or below you can do something like...
SQL> ed
Wrote file afiedt.buf
1 with table1 as (
2 select 1 c1, 'A' c2 from dual union all
3 select 2, 'B' from dual union all
4 select 3, 'C' from dual union all
5 select 4, 'D' from dual
6 ),
7 table2 as (
8 select 1 c1, 'JAN' C_MONTH,'AAA' C3 from dual union all
9 select 1,'FEB','BBB' C3 from dual union all
10 select 1,'MAR','CCC' C3 from dual union all
11 select 1,'APR','DDD' C3 from dual union all
12 select 2,'JAN','ZZZ' C3 from dual union all
13 select 2,'FEB','YYY' C3 from dual union all
14 select 2,'MAR','XXX' C3 from dual union all
15 select 2,'APR','UUU' C3 from dual
16 )
17 -- end of test data
18 select table1.c1, table1.c2
19 ,max(decode(c_month, 'JAN', c_month)) as jan_month
20 ,max(decode(c_month, 'JAN', c3)) as jan_value
21 ,max(decode(c_month, 'FEB', c_month)) as feb_month
22 ,max(decode(c_month, 'FEB', c3)) as feb_value
23 ,max(decode(c_month, 'MAR', c_month)) as mar_month
24 ,max(decode(c_month, 'MAR', c3)) as mar_value
25 ,max(decode(c_month, 'APR', c_month)) as apr_month
26 ,max(decode(c_month, 'APR', c3)) as apr_value
27 from table1 join table2 on (table1.c1 = table2.c1)
28* group by table1.c1, table1.c2
SQL> /
C1 C JAN JAN FEB FEB MAR MAR APR APR
1 A JAN AAA FEB BBB MAR CCC APR DDD
2 B JAN ZZZ FEB YYY MAR XXX APR UUU
SQL>From 11g upwards you can use the new PIVOT keyword. -
Query Help Preserve Column Format
I have the following query that cast the ouput into colunms, my issues is that I need to extend the query to add the returned results of Connector_1, Cache_1, EPS_1, Sent_1, Condition_1.... ANy ideas how I can accomplish this preserving the same columns?
SELECT NodeName,
MAX(CASE WHEN Poller_Name='Connector' THEN CAST(Status AS varchar) ELSE '' END) Connector,
MAX(CASE WHEN Poller_Name='Cache' THEN CAST(Status AS varchar) ELSE '' END) Cache,
MAX(CASE WHEN Poller_Name='EPS' THEN CAST(Status AS varchar) ELSE '' END) EPS,
MAX(CASE WHEN Poller_Name='Sent' THEN CAST(Status AS varchar) ELSE '' END) Sent,
MAX(CASE WHEN Poller_Name='Condition' THEN CAST(Status AS varchar) ELSE '' END) Condition
FROM
SELECT
Nodes.Caption AS NodeName,CustomNodePollers_CustomPollers.GroupName As GroupName ,CustomNodePollers_CustomPollers.UniqueName AS Poller_Name, CustomNodePollerStatus_CustomPollerStatus.Status AS Status
FROM
((Nodes INNER JOIN CustomPollerAssignment CustomNodePollerAssignment_CustomPollerAssignment ON (Nodes.NodeID = CustomNodePollerAssignment_CustomPollerAssignment.NodeID))
INNER JOIN CustomPollers CustomNodePollers_CustomPollers ON (CustomNodePollerAssignment_CustomPollerAssignment.CustomPollerID = CustomNodePollers_CustomPollers.CustomPollerID))
INNER JOIN CustomPollerStatus CustomNodePollerStatus_CustomPollerStatus ON (CustomNodePollerAssignment_CustomPollerAssignment.CustomPollerAssignmentID = CustomNodePollerStatus_CustomPollerStatus.CustomPollerAssignmentID)
WHERE
(CustomNodePollers_CustomPollers.UniqueName = 'Connector') OR
(CustomNodePollers_CustomPollers.UniqueName = 'Cache') OR
(CustomNodePollers_CustomPollers.UniqueName = 'EPS') OR
(CustomNodePollers_CustomPollers.UniqueName = 'Sent') OR
(CustomNodePollers_CustomPollers.UniqueName = 'Condition')
AND
(CustomNodePollerAssignment_CustomPollerAssignment.InterfaceID = 0)
)A
GROUP BY NodeName, GroupNameThese values have similar data to what is being returned by the query above, I just want the results added to the relevant columns if I run the above query I get the result:
NodeName Connector
Cache EPS
Sent Condition
Node1 Connector1
1 0.1
123 Green
Theses are values that meet PollerName CASE and where clause I want to extend this so that the same/similar set of values can be returned for the PollerName
"Connector_1, Cache_1, EPS_1, Sent_1, Condition_1.... " to the same columns but if I add these to the case and where clause all I get is doubled up columns.
I was thinking of possibly pushing the results into a table unless there is an easier/better way? -
I have a simple Query at the mo that has Employee / Master Cost Centre in the rwos and an amount key figure in the columns. Output is Employeee:Master Cost Centre:Amount. Is it possible to make it so Employee and Mater Cost Centre remains as rows but the output has the format Employee / Amount / Master Cost Centre?
Thanks
JoelThank you for your help. I'm on BI7 so I need to use the formula variable option. I've never done a formula variable - how do i create one. I've added a structure to my rows - click create formula - I've clicked to create a new variable but where do i go from here - what do I put in the variable I am creating?
-
Using a "Sum" Calculated Field on a "Count" query column?
Here's my query using the Query Report Builder:
SELECT Col1, COUNT(Col1) AS Count_Column
FROM Table
GROUP BY Col1
It generates a report that lists all the values of column
"Col1" and how many times each value was used in Col1
For instance, if Col1 contained the value 'A' 12 times, 'B' 6
times, and 'C' 19 times, the report would generate this:
A - 12
B - 6
C - 19
What i need as a column footer is the total count of all the
values, which in this case 12+6+19=37
I am using a calculated field, setting the data type to
Double, the calcuation to Sum, and the perform calculation on to
'query.Count_Column'. Reset Field When is set to None.
When I run the report, it doubles the last number in the
report's Count column (19) and displays 38 on the page. I tested
this with another column and it doubled the last number in the
report as well.
How can I get it to properly Sum my Count_Column?Hi,
You need to check note 208366.1 which explains why totals can be blank. Without knowing the detail of you decode function it is hard to say what needs to be changed. Try putting a sum in front of the decode e.g.
sum(decode(period, 'Jan period', value, 0))
Hope that helps,
Rod West -
POWL Query Column Sorting Disabled
Hello,
We are implementing MSS on Portal and using POWL for Time Approvals. For one query in POWL, the Sorting Option is disabled for all the Columns ,also when I goto the Settings Dialog -> Sort Tab , there are no Columns available under Unsorted Columns for this query,for all other queries it's there.
Where do we Configure for which Query Sorting is Enabled or Disabled for it's Columns.
Any help would be highly Appreciated.Hi Rohit,
The filter appears after clicking the header of a particular column.
The filtering behavior depend on the UI guidelines used.
If you want to switch to old behavior you can switch to 1.1 version.
Run WD application "WD_GLOBAL_SETTING".
Go to Change mode and scroll down to section "Design" and select the "UI
Guideline 1.1".
Finally save the settings.
Thanks
KH -
SAP Query column sequence for Totalling fields
Hi all
We have a custom query in 4.6C in which the output displays only the total of Totaling fields maintained in the sequence Amount > Withholding Tax > Net Amount (all currency related fields).
However after upgrade to ECC 6.0, we notice that we are no longer able to sequence the output list to Amount > Withholding Tax > Net Amount
Though we maintain the Totaling fields in the sequence Amount > Withholding Tax > Net Amount , the list is generated in the sequence Amount > Net Amount > Withholding Tax and the sequence is changed accordingly in the Basic List after a test display of the Output.
Is anyone aware if the sequencing control is removed in ECC based for the Totaling Fields?
Kindly help share.
Thanks in Advance
Vinodh SHi Faheem,
After changing the column sequence i clicked configuration button and click save button and again clicked Configuration and selected Administrative button there i can see the column sequence change and clicked activate button .now if i close and reopen the transaction my column sequence is same with out changes that i made .
you asked me to save the changes where i can do exactly ? Could you please tell in briefway from scratch so that i can trace where i done mistake.
Thanking you in advance.
Regards,
narasimha. -
Formula in Query row suppress the formula in Query column
Hi all,
I have a problem that I hope you can help me with.
I have created a query to report the following in the row:
- Units (reading the data from a cube)
- Gross Sales (reading the data from a cube)
- Discounts (reading the data from a cube)
- Net sales (a formula = Gross Sales - Discounts)
- Net sales/units (a formula = Net sales/Units)
In the column, I want to compare 2 version: Plan and Actual. Thus in the column, I have the following:
- Actual (restricted with 0VERSION=001, 0FISCPER=001.2007-012.2007)
- Plan (restricted with 0VERSION=999, 0FISCPER=001.2007-012.2007)
- Actual - Plan (a formula = Actual - Plan)
I do not get the correct result for Net Sales/Units. The reason, for as far I can analyze is because the formula in Row suppress the formula in Column.
Thus what happened:
'Description'; 'Actual'; 'Plan'; 'A-P(should be)'; 'A-P(current result)'
'Units'; 200; 150; 50; 50
'Gross Sales'; 100000; 75000; 25000; 25000
'Discount'; 20000; 10000; 10000; 10000
'Net Sales'; 80000; 65000; 15000; 15000
'Net Sales/Unit'; 400; 433,33; -33,33; 300
As you can see from the example above, I cannot get the correct result in the Actual - Plan column.
Do you know which formula/setting that I can use to get the correct result?
Any help/advice will be highly appreciated.
Thank you very much in advance.
FenSanyoto,
Use formula collision - in the K concerned right click - select properties and then you will ind a "Formula collision" dropdown in the bottom part - select the appropriate ormula for the same there.
Arun -
Input enable query column using Planning function
Is it possible to input enable a column in query based on user action in Radio button group or button group by calling a planning function or WAD?
By default the column property for query will be Planning not allowed, but a user action should change the mode to Planning allowed using planning function or entries.
ThanksHi Ravi,
you could try to write an exit data slice and a planning function which sets the data slice to not lock the data during runtime. You can find several threads in this forum. how an exit data slice can be used to control the locking of data during runtime.
Together with the command I mentioned in my last answer this may work, but it still depends on your requirements. A dataslice checks only the combination of characteristics. If you can identiy a characteristic for each column this may work. If not, there is no characteristic combination which can be locked. Please consider this when designing your application. This may lead to an additional characteristic which is used just to identify which column should be locked.
Hope this helps ...
Regards Matthias Nutt
SAP Consulting Switzerland -
Please help with column float problem in IE8
Hi there,
Sorry to be so pushy - but I am desperate for help!!
Having serious problems with my site in some PC's showing Internet Explorer 8. My right column floated right is moving down the page underneath the left column..
It shows fine on IE8 on my PC - however on my clients PC (vista with IE8) it is showing up as mentioned above. Is there a fix for this.
Here is my link http://www.dooks.com/pgs/welcome.html
The css is all there! If you need anything please let me know as I need to get this sorted - I have had serious issues with this site that I have never had before with other sites and am starting to think there is a bug in my software. I redid the index page and this one page (linked above) to see what my problems are - so help with query v appreciated.
Many thanks,
KarenLawrence_Cramer wrote:
A point to keep in mind is that IE8 is still in Beta.
Not anymore.
http://www.microsoft.com/Presspass/press/2009/mar09/03-18IE8AvailablePR.mspx
"REDMOND, Wash. — March 18, 2009 — Today Microsoft Corp. announced the availability of Windows Internet Explorer 8, the new Web browser that offers..."
Mark A. Boyd
Keep-On-Learnin' :-) -
I'm unable get XML output from the most basic of queries. I'm currently working through the Sql In Xml out document. Everytime i try to output xml i get a list (without errors) of
EMPLOYEE
<Xmltype>
<Xmltype>
<Xmltype>
<Xmltype>
<Xmltype>
for each record. Can anyone help.
Im running 10g release 2.A couple more questions
First, is the XML stored in the table as XMLType column with a schema?
Second, in sqplus, on 10R2, I just ran the following query, try it and see if what you get.
select xmlforest(object_name as "name") from user_objects where object_type = 'TABLE' and rownum < 5;
XMLFOREST(OBJECT_NAMEAS"NAME")
<name>BIN$+1aDxmVbQIau51oiplxCAw==$0</name>
<name>BIN$+3Y2EpX4TvGY4j1SIGBAMQ==$0</name>
<name>BIN$+AugUYpGSS29uaP5DnYsZQ==$0</name>
<name>BIN$+ptFT7gqTX2GgNrndS5azw==$0</name>
Elapsed: 00:00:00.02
of course your names will vary.
Scott -
Help - query dates in Object browser!
Hi to everybody,
I need help on simple thing...
how can I build a query for dates in Object browser, in Oracle XE 10g?
I tried: >01-jan-2010, >"01-jan-2010", >'01-jan-2010', <>01-jan-2010 + ... all kind of derivations and nothing.
I always receive report error:
ORA-01858: a non-numeric character was found where a numeric was expected
I just want to filter some dates ...
thanksWith dates, its usually better to be specific with the date format, and not depend on "default" settings although (for US-English) the '01-jan-2011' should have worked, maybe not.
Are you trying to filter for a specific date, or range, i.e. ... where ... <date column> = <some date> or perhaps where <date column> between <date1> and <date2> ... ?
When looking for a date, it can be helpful to ignore the time component of a date field with the TRUNC() function:
select ... where trunc( <date column>) = to_date( '01-01-2011','yyyy-mm-dd') ...Note the to_date with the format mask, that will avoid troubles with assumptions about default date formats (which can also change with the locale ... i.e. UK-English the default client date format is 'dd-mm-yyyy')
Maybe you are looking for
-
APEX 4.2. - SkillBuilders Modal Page plugin not sizing fields or labels
I recently migrated from 4.1 to 4.2, bringing over the Skillbuilders plugin 2.0.0. My page has a Popup template. When I open the page as a Skillbuilders Modal Page, all of the fields have the same width, ignoring the width I've given it with the labe
-
Bios settings on KT4A-V....
Hello, I was wondering about a setting on the KT4A-V board. There are 3 settings for performance, fast, turbo, and ultra. I set mine to ultra. What actually happens to make this work? Thanks
-
How to Configure CATS Profiles in order for the Hours to be posted to CO
Hi All, I have quick question for you all, how do I configure the CATS Time Entry Profiles so as to enable me to post the Hours (Different Receiving Cost Centers & Receiving Internal Orders) to CO. Currently I enter time using TCODE: CAT2 and a CATS
-
Any reason I shouldn't do it this way? RAID backup question
I'm using three 1TB drives torn out of Western Digital external hard drives (hard to find internal drives in Italy) as a RAID 0 for 3TB internal storage in the three extra internal bays. I'd like to mirror that, or something close to it, for a reason
-
Software Updates won't install after Lion Upgrade
I can't install the iTunes or iWork for Lion update.