How to use previous TDMS data to simulate incoming data offline
This is not a cRIO question, but a LabVIEW question. I would like to not have to connect to my cRIO everytime I want to develop my real time code. How can take a previously saved TDMS data and have Labview read the values from this file one line at a time so that the code runs just as if I were logging new data from the sensors?
Here's a lengthy example to better clarify the question: I'm using LabVIEW 2011
I'm using Scan Engine to read say, 10 channels on my cRIO every 100ms. The values from each channel come into my processing loop as an interleaved 1D array where I can process the data and save it as a row in a TDMS file. Then 100ms later I get a reading for row two in the TDMS file, then row three etc.
Now say I just want to tweak a few things on my processing loop like add a new chart etc. and want to make sure it displays properly but do not want to reconnect to the cRIO. Can I reference the saved TDMS file and get LabVIEW to send the same interleaved 1D array of 10 channels every 100ms so it simulates just the way the actual data would come in from the cRIO?
Hi jezza,
You can use the TDMS VIs to read from the file, specifying an array of doubles so that we don't have to get the waveform components in order to get the Y values. We then just build an array on a for loop and set a delay of 100 mS. You can optimize this using a Producer Consumer Architecture if you are worried that the processing VIs are going to take more than 100 mS.
Regards,
Daniel REDS
RF Systems Engineer
Help us grow.
If a post solves your question, mark it as The Solution.
If a post helps, give Kudos to it.
Similar Messages
-
How to use Add Query Criteria for the MySQL data Base in Netbeans ?
How to use Add Query Criteria for the MySQL data Base in Netbeans Visual web pack.
When the Query Criteria is add like
SELECT ALL counselors.counselors_id, counselors.first_name, counselors.telephone,counselors.email
FROM counselors WHERE counselors.counselors_id = ?
when i run this Query in the Query Window
i get a error message Box saying
Query Processing Error Parameter metadata not available for the given statement
if i run the Query with out Query Criteria its working fine.*I am glad I am not the only one who have this problem. Part of issue has been described as above, there are something more in my case.
Whenever I try to call ****_tabRowSet.setObject(1, userDropList.getSeleted()); I got error message as shown below:*
The Java codes are:
public void dropDown1_processValueChange(ValueChangeEvent event) {
Object s = this.dropDown1.getSelected();
try {
this.User_tabDataProvider1.setCursorRow(this.User_tabDataProvider1.findFirst("User_Tab.User_ID", s));
this.getSessionBean1().getTrip_tabRowSet1().setObject(1, s);
this.Trip_tabDataProvider1.refresh();
} catch (Exception e) {
this.log("Error: ", e);
this.error("Error: Cannot select user"+e.getMessage());
SQL statement for Trip_tabRowSet:
SELECT ALL Trip_Tab.Trip_Date,
Trip_Tab.User_ID,
Trip_Tab.Destination
FROM Trip_Tab
WHERE Trip_Tab.User_ID = ?
Error messages are shown below:
phase(RENDER_RESPONSE 6,com.sun.faces.context.FacesContextImpl@5abf3f) threw exception: com.sun.rave.web.ui.appbase.ApplicationException: java.sql.SQLException: No value specified for parameter 1 java.sql.SQLException: No value specified for parameter 1
com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.cleanup(ViewHandlerImpl.java:559)
com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.afterPhase(ViewHandlerImpl.java:435)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:274)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:184)
com.sun.webui.jsf.util.UploadFilter.doFilter(UploadFilter.java:240)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:216)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:184)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:216)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:184)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:276)
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:240)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:179)
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239)
com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
tandardWrapperValve[Faces Servlet]: Servlet.service() for servlet Faces Servlet threw exception
java.sql.SQLException: No value specified for parameter 1
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910)
at com.mysql.jdbc.PreparedStatement.fillSendPacket(PreparedStatement.java:1674)
at com.mysql.jdbc.PreparedStatement.fillSendPacket(PreparedStatement.java:1622)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1332)
at com.sun.sql.rowset.internal.CachedRowSetXReader.readData(CachedRowSetXReader.java:193)
at com.sun.sql.rowset.CachedRowSetXImpl.execute(CachedRowSetXImpl.java:979)
at com.sun.sql.rowset.CachedRowSetXImpl.execute(CachedRowSetXImpl.java:1439)
at com.sun.data.provider.impl.CachedRowSetDataProvider.checkExecute(CachedRowSetDataProvider.java:1274)
at com.sun.data.provider.impl.CachedRowSetDataProvider.setCursorRow(CachedRowSetDataProvider.java:335)
at com.sun.data.provider.impl.CachedRowSetDataProvider.setCursorIndex(CachedRowSetDataProvider.java:306)
at com.sun.data.provider.impl.CachedRowSetDataProvider.getRowCount(CachedRowSetDataProvider.java:639)
at com.sun.webui.jsf.component.TableRowGroup.getRowKeys(TableRowGroup.java:1236)
at com.sun.webui.jsf.component.TableRowGroup.getFilteredRowKeys(TableRowGroup.java:820)
at com.sun.webui.jsf.component.TableRowGroup.getRowCount(TableRowGroup.java:1179)
at com.sun.webui.jsf.component.Table.getRowCount(Table.java:831)
at com.sun.webui.jsf.renderkit.html.TableRenderer.renderTitle(TableRenderer.java:420)
at com.sun.webui.jsf.renderkit.html.TableRenderer.encodeBegin(TableRenderer.java:143)
at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:810)
at com.sun.webui.jsf.component.Table.encodeBegin(Table.java:1280)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:881)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:889)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:889)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:889)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:889)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:889)
at com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:271)
at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:182)
at com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.renderView(ViewHandlerImpl.java:285)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:133)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:244)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:184)
at com.sun.webui.jsf.util.UploadFilter.doFilter(UploadFilter.java:240)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:216)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:184)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:216)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:184)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:276)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:179)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
Also when I tried to update my MYSQL connector / J driver to version 5.1.5 from 5.0.5 (NB 5.5.1) and 5.0.7 (NB 6.1), I could not get it work (looooong time to search some JDBC classes and with no response in the end) on both of my Netbean 5.5.1(on PC) and Netbean 6.1(on laptop) IDEs.
Could anybody look into this issue.
Many thanks
Edited by: linqing on Nov 22, 2007 4:48 AM -
How to use the customer types in customer master data
how to use the customer types in customer master data?
menu path is Extras -> account group info -> customer typeshi,
This is an option given to you to choose (if you need to) the way you perceive this customer.Here you get options including ompetitors,Salespartner, prospect,
default sp ,consumer.
See it helps you to differentiate between prospect(which you may use for quotation or inquiry purpose)Sales partner and the competetor.
I hope this clarifies your quiery.Reward points if so.
Thanking you,
Best regards,
R.Srinivasan -
How to use for all entires clause while fetching data from archived tables
How to use for all entires clause while fetching data from archived tables using the FM
/PBS/SELECT_INTO_TABLE' .
I need to fetch data from an Archived table for all the entries in an internal table.
Kindly provide some inputs for the same.
thanks n Regards
RameshHi Ramesh,
I have a query regarding accessing archived data through PBS.
I have archived SAP FI data ( Object FI_DOCUMNT) using SAP standard process through TCODE : SARA.
Now please tell me can I acees this archived data through the PBS add on FM : '/PBS/SELECT_INTO_TABLE'.
Do I need to do something else to access data archived through SAP standard process ot not ? If yes, then please tell me as I am not able to get the data using the above FM.
The call to the above FM is as follows :
CALL FUNCTION '/PBS/SELECT_INTO_TABLE'
EXPORTING
archiv = 'CFI'
OPTION = ''
tabname = 'BKPF'
SCHL1_NAME = 'BELNR'
SCHL1_VON = belnr-low
SCHL1_BIS = belnr-low
SCHL2_NAME = 'GJAHR'
SCHL2_VON = GJAHR-LOW
SCHL2_BIS = GJAHR-LOW
SCHL3_NAME = 'BUKRS'
SCHL3_VON = bukrs-low
SCHL3_BIS = bukrs-low
SCHL4_NAME =
SCHL4_VON =
SCHL4_BIS =
CLR_ITAB = 'X'
MAX_ZAHL =
tables
i_tabelle = t_bkpf
SCHL1_IN =
SCHL2_IN =
SCHL3_IN =
SCHL4_IN =
EXCEPTIONS
EOF = 1
OTHERS = 2
OTHERS = 3
It gives me the following error :
Index for table not supported ! BKPF BELNR.
Please help ASAP.
Thnaks and Regards
Gurpreet Singh -
How do I Configure my Router to forward incoming data for port x ???
How do I configure my router to forward incoming data for port whatever?
I need this for my video games.Depending on which router you have look under Gaming and Applications or system management for a Forwarding tab. From there you select (or create) the port needed for your game with the IP address to the PC with the games you are using. You may also have to configure Port Triggering for that game/port range/and IP to the hosting PC.
Richard Aichner (Ikester) -
How to use previous year keyfigure data in current year for other keyfig
Hi Expert,
I have 1 requirement wherein I need to use previous year data for some keyfigure calculation.
Details are as follows:
I have designed query with CKFs Turnover & UVG (in rows) & Fiscal year period in columns.
Suppose Keyfigure Turnover data is displayed from Apr2009 to Mar 2011. In UVG: for Apr 2010, i need Turover data of month Apr 2009, for May 2010 turnover data of May 2009 similarly for other months.
As per my understanding, I need to use customer exit which will store kf turnover data in internal table & in turn it will be used for UVG.
But I'm not able to put it into syntax.
Kindly suggest your inputs in this scenario.
Thanks,
ShamkantHi
Note that the variable ZCALCCALMTH is exit type and variable ZCALMTHREF is ready for input.
WHEN 'ZCALCCALMTH'.
IF i_step = 2. "après le popup
READ TABLE i_t_var_range INTO loc_var_range WITH KEY vnam = 'ZCALMTHREF'.
IF sy-subrc = 0.
CLEAR l_s_range.
year1(4) = loc_var_range-low(4).
year1(4) = zyear1(4) - 1.
zmonth1(2) = loc_var_range-low+4(2).
CONCATENATE zyear1(4) zmonth1(2) INTO loc_var_range-low(6).
zyear2(4) = loc_var_range-high(4).
zyear2(4) = zyear2(4) - 1.
zmonth2(2) = loc_var_range-high+4(2).
CONCATENATE zyear2(4) zmonth2(2) INTO loc_var_range-high(6).
l_s_range-low = loc_var_range-low(6).
l_s_range-high = loc_var_range-high(6).
l_s_range-sign = 'I'.
l_s_range-opt = 'BT'.
APPEND l_s_range TO e_t_range.
ENDIF.
ENDIF.
bye
Boujema -
How to use LSMW on CRM for bulk master data creation?
Hello Experts,
I need your help to able to use LSMW on CRM for bulk master data creation. Below is described my detailed requirement; -
We have CRM 2007 integrated with SAP ISU (ECC6.0). As per business process all Business Master Data (BP details, Business Agreement details etc) and Technical Master Data (Connection Object, PoD etc.) is created in CRM and then it is replicated in ISU. We are going to start Assembly Test soon. Now we need to have all master data in place. Tool we want to use is LSMW.
Now can you help me right from scratch on how to use LSMW for bulk master data creation in CRM?
Please give me documents / links etc that is relevant.
Regards,
RohitHi,
I have looked into your query.
These are some information which might be useful to you.
What is LSMW?
Legacy System Migration Workbench or LSMW is SAP standard program that can be used to easily load / change master data or transactions in SAP without any programming at all. It can be used to upload data at cutover, such as: open orders, contracts, materials, vendors, stock on hand. It can also be used in a production system to make changes to existing data. Very limited authorization checks are available on the transaction, so the use of it must be very well controlled.
One input file can be used to create all the views of the material master. For all the material types. Even if different views and fields are used for the different materials.
Steps to take
1. Create text file with data to be loaded
2. Set up and run LSMW
The following link will provide good information on LSMW Idoc method:
[http://help.sap.com/saphelp_nw04/helpdata/en/ad/2d54a41d7011d2b42e006094b944c8/frameset.htm]
I hope this helps.
Regards,
Venkat -
How to use standard Search Input Help (return 2 data code and desc) ?
Hi,
Please advise how to use standard Input Help provided by SAP and return 2 data (code and description) ? because the standard Input Help only return the code only ?
Thank You and Best Regards
Fernand>
Saket Abhyankar wrote:
> Hi,
>
> I think you need to go for 'Search Help Exit' or OVS.
>
> Regards,
>
> Saket.
That is not true that this is the only way. The standard Data Dictory based search help can return more than one value as long as there are multiple exporting values defined in the search help, the search help is attached to a Data Dictionary Structure, and this same data dictionary structure is used as the source of the context node. You can read more about this in the online help:
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/47/9f724642314aabe10000000a42189b/frameset.htm
The Note section under Integration:
If an input help structure is stored in a field in the ABAP Dictionary, and if you want to use the field mapping of search help parameters stored in the ABAP Dictionary as the field name for the structure for your Web Dynpro input help, then map your context nodes to this structure. This ensures that all components of the structure are available dynamically at runtime as attributes of the node.
If the context node is not mapped to the structure, the data element's input help can be used if there is one. -
How to use 2 Dropdown box in webapplication for date range selection
Dear all,
I am working on a report that will show 2 drop down boxes. These should be used as a date range.
This works fine if I use 2 variables as a date range on 0CALYEAR. However I dont want the user to fill in the dates but selecting the dates with 2 drop down boxes.
I cannot manage to get this to work. I saw some comments about user exits in the forum but I cannot figure it out if there is an easier way.
Could you give me an idea of what to do?
Thanks a lot,
AndreasHi,
If you want the user to select the date directly rather than entering, you need not to have a dropdown menu in WAD. Directly go to the query which you have selected for the object in WAD, there create a variable with calendar. Put it mandatory, so that the user selection of the date will be mandatory. The variable will be automatically be available when you execute the template inn the browser.
Assign points if this helps u.
Regards,
Koundinya. -
How to use CVI or VC function to exchange data between 78xxR and CVI or MFC exe
with the Labview FPGA module,I write down th FPGA program on the 78xxR,and then use Labview to program for the data exchange between the host PC and the FPGA board. the question is that I have many programs written in CVI or MFC, I think if some c function can access the FIFO of the 78xxRunder under CVI or VC,for example, some functions available to copy data to or from the FIFO, then the old program can easily be change to use 78xxR board. can someone tell me?
now I use "Call Library Function Node" to load a dll that open shared memory created in CVI or MFC exe, use "Call Library Function Node"to read data from the shared memory and then use LV function to write data to FPGA; use LV "read/write control" node to Read data from the FPGA and then use "Call Library Function Node" to write data to shared memory. and a CVI or MFC exe read or write data to or from the shared memory, it works but isn't a good method, can some one has better method?Hi, david2K:
As there is no FPGA module supported for CVI or MFC, using "Call library Function node" is the only way to solve your problem until now.
You have many programs written in CVI or MFC, so you can build the LabVIEW program as dll, and call it in CVI.
Hope it helpful!
Jing Zhang
Application engineer.
[email protected] -
I think the class in the packet will be useful.
But I don't konw how to use it.
Do you get me a example.
Thanks.Hi,
Issue has been resolved. I used the value of the element to determine to display it or not.
Regards,
Swapnil K. -
How to use a variable multiple times in the data flow
DECLARE
@StartTime datetime,
@EndTime datetime
SET @StartTime = (SELECT MAX(AvailDateTime) FROM dbo.Fact)
SET @EndTime = (SELECT MAX(AvailDateTime) FROM dbo.Product);
--DATEADD(day, 1, @StartTime);
--PRINT @StartTime
--PRINT @EndTime;
WITH
dates AS (
SELECT DATEADD(Minute,5,@StartTime) AS [date]
WHERE DATEADD(Minute,5,@StartTime) <= @EndTime
UNION ALL
SELECT DATEADD(minute, 5 ,t.date) AS [date]
FROM dates t
WHERE DATEADD(minute, 5, t.date) <= @EndTime
I have the above sql, in this I'm using the 2 variables and calling @Starttime Variable couple of time. How should I build the SSIS package based on this query? how can I call the same variable in different place? how will SSIS take it?
ThanksSince you have the variables set in code you just can place this code into the SQL code section of say an OLEDB source
like there
or -
How to use case and decode to extract the data
Hello PL/SQL Gurus,
I am using Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production version
I have a table in following format -
drop table TT2;
create table TT2(College, Class,gender,status,fees) as select
'IITB','MBA','M','P',255600 from dual union all select
'IITK','MTech','M','P',300000 from dual union all select
'IITD','MBA','F','P',450000 from dual union all select
'IITKH','MBA','F','P',350000 from dual union all select
'IITC','MTech','F','P',420000 from dual union all select
'IITB','MTech','M','P',185000 from dual union all select
'IITC','MTech','M','P',235000 from dual union all select
'IITD','MBA','F','F',175000 from dual union all select
'IITM','MBA','M','F',257000 from dual union all select
'IITKH','MTech','F','P',335000 from dual union all select
'IITD','MBA','F','P',540335 from dual union all select
'IITC','MBA','F','F',125089 from dual union all select
'IITD','MTech','M','P',290756 from dual union all select
'IITM','MBA','M','P',200000 from dual union all select
'IITKH','MBA','F','F',534990 from dual union all select
'IITD','MBA','F','P',221000 from dual ;some of the extraction conditions are as following -
CASE CONDITION
College in 'IITB' and status='P'- 'WestRegion Passed'
College in 'IITC' and status='P'- 'SouthRegion Passed'
College in 'IITD' and 'IITK' and status='P' and Gender='F' - 'NothRegion Female Passed'
College not in 'IITK' and status='F' - 'Ex Kanpur Failed'
Expected output -
Region Statnding Fees
WestRegion Passed 440460
SouthRegion Passed 655000
NothRegion Female Passed 1386335
Ex Kanpur Failed 1092079SQL Used
I am using the following query which only make sure of case but this is not how i want the output , if i try to use the case within decode then how to work on this -
SELECT (CASE WHEN College in ('IITB') and status='P' then sum(fees) else 0 end) WP,
(case when College in ('IITC') and status='P' then sum(fees) else 0 end) SP,
(case when College in ('IITD','IITK') and gender='F' and status='P' then sum(fees) else 0 end) NFP,
(case when College in ('IITK') and status='F' then sum(fees) else 0 end) ExKF
FROM
TT2
GROUP BY College, Class,gender,statususer555994 wrote:
Thank you so much jeneesh i am really thankful to you ...vov.
one more query in case if any of the selection don't have the output data , then values will be displayed like -One way..
with t as
--"Add all your descriptions
(select 'WestRegion Passed' region_standing from dual union all
select 'SouthRegion Passed' region_standing from dual union all
select 'NothRegion Female Passed' region_standing from dual union all
select 'Ex Kanpur Failed' region_standing from dual)
select region_standing,sum(fees) fees
from (
(SELECT CASE WHEN College in ('IITB') and status='P'
then 'WestRegion Passed'
when College in ('IITC') and status='P'
then 'SouthRegion Passed'
when College in ('IITD','IITK') and gender='F' and status='P'
then 'NothRegion Female Passed'
when College in ('IITK') and status='F'
then 'Ex Kanpur Failed'
else 'Others' end region_standing,
sum(fees) fees
FROM TT2
GROUP BY CASE WHEN College in ('IITB') and status='P'
then 'WestRegion Passed'
when College in ('IITC') and status='P'
then 'SouthRegion Passed'
when College in ('IITD','IITK') and gender='F' and status='P'
then 'NothRegion Female Passed'
when College in ('IITK') and status='F'
then 'Ex Kanpur Failed'
else 'Others' end
union all
select region_standing,0
from t
group by region_standing;
REGION_STANDING FEES
Others 2567835
NothRegion Female Passed 1211335
WestRegion Passed 440600
Ex Kanpur Failed 0
SouthRegion Passed 655000
{code}
Edited by: jeneesh on Nov 5, 2012 5:07 PM -
How to use MONTH NAME in where condition in date column?
Hi dudes,
this is the table.
sql>desc ACMINUTESPDFTEST;
Name Null? Type
ACDATE DATE
TYPES VARCHAR2(10)
here i have tried the following 2 queries,but i could not get the correct result
select types,seqno,acdate from ACMINUTESPDFTEST where acdate like to_date('NOV','MON');
or
select types,seqno,acdate from ACMINUTESPDFTEST where acdate = to_date('NOV','MON');
(for both the query the output is same)
TYPES ACDATE
PINK 01-NOV-10
but the table having following data:
TYPES ACDATE
PINK 14-NOV-10
WHITE 15-NOV-10
PINK 01-NOV-10
Any suggestion why i could not get correct result.bharathit wrote:
Thanks for toon and divya...it solved my problem and my question how will you select between two months..
select types,acdate from ACMINUTESPDFTEST where to_char(acdate,'MON') >= 'SEP' AND to_char(acdate,'MON') <= 'OCT';
and i got
no rows selected
Edited by: bharathit on Nov 2, 2010 10:37 PMIf you're interested in finding dates in a range of months regardless of the year then try this:
select ...
from ...
where to_number(to_char(date_column,'MM')) Between 9 And 10;You could also do something like:
select ...
from ...
where to_number(to_char(date_column,'MM')) In (1,4,7,10);If you are interested in dates in a range of months in a particular year however, use something like this:
select ...
from ...
where date_column >= date '2010-09-01' and
date_column < date '2010-11-01' and -
I know this has got to be a common question but I can't find the answer anywhere.If I reinstalled tiger and alot of things are not working correctly, or is asking for serial numbers etc when starting an application how do I get the information from the previous folder to the hard drive thanks james
Without knowing what software you're talking about, nobody can make any guess as to where the registration info may be or what files may be needed. Your best and fastest route would just be to re-enter the serial numbers manually.
In the future, please use Carbon Copy Cloner or SuperDuper to make an exact clone of your system to an external drive before reinstalling the OS.
Maybe you are looking for
-
Ias 10.1.2.3 glitches in chgiphost to change the IP address
RHEL 4, Kernel 2.6.9-67.0.1 After recently patching our ias from 10.1.2.2 to 10.1.2.3 we did in depth testing on our developement server. After that we copied the whole server (VMware virtual machine) to our test server. On this test server I changed
-
Multiprovider query selection screen
HI, I have a query built on multiprovider. Multiprovider has two underlying infocubes. At selection screen user wants to input only one field , say field 'A'. Field 'A' exists in one infocube only . when I restrict query on selection screen with fie
-
Hi Guys, I am calling the FindUser method and my query works fine. How do I seach using an "OR" query? Meaning, if a <userattribute>=<value> OR <userattribute2>=value2. I am able to do and but can't figure out or? Thanks, ksingh23
-
Unknown error while trying to restore through iTunes
I was switching between channels when the unit became sluggish in responding to the remote.The screen went black and the USB to iTunes icon popped up on the screen. After some time and a google search I read what I had to do- using Itunes to restore
-
Hi all, I want to study the OEL certification. I saw that the exam 1Z0-402 is validated against Oracle Enterprise Linux (OEL) Version 4. I'm working everyday on OEL Version 5.x As that exam covers the basics of Linux administration : I suppose studyi