Calculating the Count value
Hi friends,
I have personnel planning cube,i need to calculate the no.of Personal Id's for each cost center..and retreive the Count value and save it to a keyfigure with type Number.
I know that we can do this in FOX,Can anyone please provide me with the sample code for the above requirement.
Thanks In Advance.
Regards,
Ravi.
Edited by: ravi kanth on Sep 15, 2009 12:34 PM
Hi Ravi,
Counter type I.
FOREEACH PERSONAL ID.
COUNTER = COUNTER +1.
{KF, Personal id} = {KF, Personalid}.
ENDFOR.
(Count,personalid} = counter.
Hope this gives you an Idea but let me know you need more information.
Regards,
Raj
Similar Messages
-
I would like to know how i can create a bell graph with out using sub VIs, the data that i created consists in 500 readings with values of 0 to 100, i calculated the mean value and standard diviation. I hope some one can help me
Here's a quick example I threw together that generates a sort-of-bell-curve shaped data distribution, then performs the binning and plotting.
-Kevin P.
Message Edited by Kevin Price on 12-01-2006 02:42 PM
Attachments:
Binning example.vi 51 KB
Binning example.png 12 KB -
Hi everyone,
I'm building a heart rate monitor as a final year project with my lab partner using the NI USB-6009 and Labview 2009. We have managed to obtain a signal using a photo transciever, smooth it out and count the events, however the count is incremental.
We wish to count the number of pulses we obtain for a few seconds (5-10 for example) and then use this value to obtain a pulse rate in beats per minute (e.g. 10 pulses in the first 10 seconds would give an estimated BPM of 60 etc etc).
Does anybody have ides on how we could implement this? We have tried timed loops, elapsed time VI's and other things but nothing gives us what we need.
Thanks in advance for any help that is offered.
Jeshua Graham.We are very new to Labview. We are taking a raw signal from our DAQ and then using VIs to filter and then trigger counts on rising edges. I have attached our vi file to this post for you to look at (I hope that is what you mean by code).
Attachments:
TCRT-1010DAQ_jeshua1.vi 367 KB -
Calculating the actual value when creating the input schedule on BPC NW 7.0
Hello Experts,
I have One questions regarding the calculation when building the input schedule.
the structure of this input schedule is like this:
CV: App01-time-entity-account-version-p_datasource ...
Plan Value Actual Value
Project 1000
In the backend of BPC ,The Actual value is retrived from other system using BW DTP function, and with the monthly based line item. We build the BPC-mutiprovider by the actual value cube and the plan data cube.
From the BPC Office view, we want display the actual value by aggregating historice data till the month which user selected in the current view. These actual data is just the reference for user when they input the plan data. so we dont want these data stored in the application or database.
Can anyone give us some hints?
Thanks a lot in advance!
Best Regards,
Vivi
Edited by: Vivi Sun on Jan 19, 2009 1:12 PMVivi,
Were you able to accomplish what you were looking to do? I would appreciate if you could share that info with us.
Thanks. -
Calculating the mean value in a query
Hi,
I am trying to build a query which will give the mean amount of sold products during certain number of months. The month is a variable which is given by the user so the query should be able to calculate the mean value based on the amount of months. For example:
Product - Month - Amount
123456 - 01.2007 - 5pcs
123456 - 02.2007 - 2pcs
123456 - 03.2007 - 0pcs
123456 - 04.2007 - 2pcs
The above data should be displayed as follows (522 => 9/3 the mean value is 3):
Product - Amount
123456 - 3pcs
I am able to calculate the following:
Product - Month - Amount
123456 - 01.2007 - 5pcs
123456 - 02.2007 - 2pcs
123456 - 03.2007 - 0pcs
123456 - 04.2007 - 2pcs
123456 - 3pcs
the above solution is however not correct since the result of the query should be displayed in only one row. Does anyone know how this could be done?
Thanks
Sarah
Message was edited by:
SPSP,
Does the user enter a single month or multiple months? Are you using any product hierarchy?
Well, you can have the product in the rows and in the columns you can count the number of months entered by the user by using a customer exit variable. So for a product the aggregated value of the pcs will be displayed in one column for the months entered by the user. You can hide that column and the value returned by the customer exit will give the no. of months. So you can get the mean value by diving the aggregated value of the pcs by the no of months.
This should solve your issue.
To make it more clear
Rows:
Product
Columns:
New selection:
key figure pcs
month infoobject restricted by teh user entry variable.
New formula
create a new formula variable and use it in the formula
This formula variable should be of type user exit. In the
user exit code you will be reading the variable for month(which the user enters) and count the no of months. So this variable will output the no of months. Hide this formula.
New formula
Divide column1 by column2.
It will give you the desired output. -
Multivalue# Error in the count value
Hi,
Please help me on this. I am getting Multivalue# Error in the code below.
=If (Count([Subclass ID]) <=5;"Subclass: " + [Subclass ID]; " No of Subclass Selected: " + Count(Subclass ID))
Thanks you in advance.
RoseHi Rosemarie,
WEBI aggregates only duplicate rows and when we try to aggregate non duplicate rows it throws #Multivalue error.
The #Multivalue error comes for different reasons:
1) If you are displaying output of formula in single cell then you will get #Multivalue error when formula returns multiple values.
2) If your data contain non duplicate values and you are trying to aggregate the data using sum, count and removing the column that contain distinct value.
I checked this with Island and resort marketing Demo universe.
I Took country and Future Guests and applied formula similar to yours:
=If(Count([Futureguests])<=5;"Subclass "[Futureguests];"No of subclass"Count([Futureguests]))
When I removed the column Future Guests from the report I got #Multivalue error because this is the column that distinguishes the records.
It you want to avoid this,
1) Check the option u201Cavoid Duplicate row aggregationu201D by selecting Block-> properties-> Display
OR
2) Add the column Subclass ID in the report
OR
3) Use Count(Subclass ID) like this.
=If (Count([Subclass ID]) <=5;"Subclass: " + count([Subclass ID]); " No of Subclass Selected: " + Count(Subclass ID))
I Hope this Helpsu2026.
Thanksu2026
Pratik -
Can I count the PWM pulses and note the timer value simulataneously.
Im using 6024E. I want to be used for 1-phase motor control. I could generate PWM pulses and read the feedback analog current, but I am unable to read the velocity of the motor. Counting PWM pulses(generated by sensor for each degree of rotation) and reading the digital timer value simultaneously to calculate velocity of the motor. If any body can give the solution it will be appreciated
Attachments:
motor_control_ver1.0.llb 210 KBHello;
In case you can read a digital pulse train that would give you the speed of the motor, you can use one of the counters of the DAQ board you have to accomplish that.
You can configure the counter as buffered event counter, hook up the digital pulse train to the counter gate, and since you have the frequence of the internal timebase that is connected to the counter input, you can calculate the speed of the motor by having the count values that are stored at the event of a gate input pulse.
Hope this helps.
Filipe A.
Applications Engineer
National Instruments -
Servlets: Will the value of the counter be kept?
Good morning fellow forum users.
I'm using a static counter.class to keep track of the number of times an input is made.
import java.util.*;
import java.awt.*;
public class counter {
static private int count = 0;
public counter() {
} // constructor
static public void increment() {
count++;
}// end of increment()
static public int getCount() {
return count;
} // end of getCount()
} // end of counter class
In the program, whenever an input is being made by the user, I'd call
counter.increment();
the same servlet is called by different JSP pages
(eg. init.jsp -> select.jsp -> select.jsp -> select.jsp etc)
I check for the counter value using an
if (counter.getCount() == 3) { do something };
but this "do something" is never executed.
Query 1: Is my Static counter's value still valid when different JSP pages call it?
Query 2: Is there anyway i can system.out.println(counter.getValue()) to check my counter value, for nothing is shown when i used that in my servlet.
Thank you for your kind attention! :)(1)Synchronize the methods.
(2)Your counter class does not need constructor.
I check for the counter value using an
if (counter.getCount() == 3) { do something };
but this "do something" is never executed.Because it was not 3.
Query 1: Is my Static counter's value still valid when different JSP
pages call it?Use synchronization. It should be valid if your definition of 'valid' is proper.
Query 2: Is there anyway i can
system.out.println(counter.getValue()) to check my counter value,
for nothing is shown when i used that in my servlet.No such method: counter.getValue()
Message was edited by:
hiwa -
I have been trying to work this out an I am sure is is not too difficult to do, but I cant seem to get anywhere with it. If anyone could help that would be great.
Thanks
RossHI am not currently at a PC with LabVIEW on, so Ic ant send you an example of how to do this. Instead you'll have to understand my description....
I'll assume that you want to constantly monitor the input value...
Use a while loop with a shift register to store the count value. You can initialise the count value to zero (or whatever you like) by wiring a numeric constant to it - to the left of the shift register - outside the loop. Place a case structure inside the loop and wire the shift register left to right through the false case. In the true case place the increment function and connect it between the input and output nodes you now have on the case structure. On each iteration of the loop the count value will either remain the same or be incremented b
y one depending on whats wired to the boolean input on the case structure. Now you need to detect whether your ascii value is in range. You can use the 'In range and coerce' function for this (found in the comparison function pallette). Wire the range values and the input value to it and take the boolean output to the input of the case structure. The ascii value must be acquired within the loop, so that you are checking the updated value on each iteration (or if it comes via an array you could wire the array directly to the outside of the loop and enable indexing - in this case it would be best to use a for loop). You can place an indicator on the 'count' wire to monitor its value if you wish. Remember to also place some conditional statement to stop the loop when required and also a wait function should exist inside the loop. When the loop stops, the count value will be available at the output of the shift register.
Hope this helps and is clear enough for you to implement?! -
How to pass the prompt value to repository variable in obiee 11.1.1.7
Hi All,
I am given a tabular report to build in OBIEE 11.1.1.7 version using insurance data.
I have to show different types of claim names and their corresponding count in the table. One of the calculations require me to use the total no of claims(i.e sum of all the claims).
Example:
Total No of claims: 600
Total No of Auto Claim: 60
I have to create a table on Auto Claim like:
claim types count
X 10
Y 20
Z 30
I was calculating total no of claims by using dynamic repository variable as it was a constant value. Example: repository_variable1: select count(claim ID) from Insurance; In report I was just using value of (repository_variable1)
Now client has asked us to give date prompt so the total no of claims (assumed as 600) will change with respect to period. I can calculate total no of claims with respect to different claim type (as shown in the table above) with respect to period filter in the report.
The problem I am facing now is, I need the count of all the claims on a partucular period too. Repository variable is giving always calculating the count as 600. But the count should change with respect to period selected. How to get this value?
Can I create a presentation variable in the prompt and pass this value as an argument for repository variable?
Please help. I am in urgent need of the solution.
Thank you.Hi Srini,
I tried creating it as metric. But the problem is my pivot table is on Auto Claims.
Let me try to make myself a bit more clear.
Total No of claims in fact table: 600
Total No of Auto Claims in fact table: 60
claim types(auto claims) count Calculation
X 10 10/600
Y 20 20/600
Z 30 30/600
So I need to access total no of claims to calculate. I cant use a metric as the count will take group by with respect to auto claim type and give value only for X claim. -
How to pickup the Attribute Value
FY09 Labor Hours 21014 No_Task_A 12385 USD Actual_Project
Apr May Jun Jul Aug Sep Oct Nov Dec Jan Feb Mar
A Tot_Project Proj_Countz 30 31 31 31 27 29 25 25 24 28 25 24
Tot_Project Man_Mos 0.9996 1.0007 0.9999 0.9992 1.0001 0.9995 0.9994 1.0004 1.0001 1.0003 1.0004 1.0004
Basically I am trieng to achive the Total Man Mon/Total project =0.9996/30.First I calculated the count of the Project Dimension and stored in Proj_countz member then the Man_Mon values are loaded from source.
next we need to calculate Avm=Man_Mos/Proj_Countz->A. The Rank is Attribute dimension similarly we have to calculate for all the different Ranks (A,AA,etc) .I have tried to write the below calc but giving me the same value of Man_Mos It is not giving me a correct result hence please help me to resolve this issue.
"Avm"(
IF(@ISMBR("Tot_Project",@Attribute(A)))
Avm=Man_Mos/Proj_Countz
ENDIF;
Thanks,
IrshSince you claim you have tried using DOM but it is not working, how can we help?
Since I can see the Element entry in the JavaDocs has a getAttribute( "host") method that can return the "192...." value, and a setAttribute("host", newvalue) method that can set the attribute to a new value, I guess you did not get an Element, or do not know what to do with an Element. (This is a hint for you.)
Post your code and someone may be willing to offer a suggestion.
Dave Patterson -
Design Table with no of columns used for calculating the total
Hello,
I need to design a table/s for calculating the column values based on the operators provided. Like I have a table say
TableID, Col1 , Col2 ,Col3 ... Total Value
Total Value Column is calculating Col1 (operator value provided by the user) Col 2 (operator value provided by the user) Col3 etc
Although I m thinking to create another table which stores operator values, however not sure how to calculate the total.
like it can be COl 1 +Col2 -Col3 %Col4 etc.
Please help.Can you show some data example+ desired result?
DECLARE @t TABLE(a INT,b INT,c INT);
INSERT @t VALUES(1,2,3),(9,8,7),(4,6,5);
SELECT *
, ( SELECT COUNT(val)
FROM (VALUES (a)
, (b)
, (c)
) AS value(val)
) AS CountVal
FROM @t;
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
How to get counter values from pci 6221 card?
Hii
I am using PCI 6221 card .. In that i am using the ctr o .. In my application i am using Linear encoder to measure the Lift movement.. so from software how to access the counter values i.e how much mm it moves...Measure Angular Position.vi in the LabVIEW examples will be a good starting point. Adapt it to Linear Encoder by clicking on the selector below DAQmx Create Channel.vi.
You can also create a corresponding DAQmx Global Channel (or task) in MAX and then use it in your code.
Feel free to post back if you need further help.
Message Edité par JB le 10-31-2008 02:15 PM -
Hello, Expert,
Could you please help me with the following problem? Thanks in advance!
I have designed the matrix report (SSRS 2012) with database table structure looks like below.
Week
Version
Count
Week1
V1.1
4000
Week1
V1.2
4000
Week1
V1.3
4000
Week2
V1.1
3000
Week2
V1.2
3000
Week2
V1.3
3000
Week3
V1.1
2000
Week3
V1.2
2000
Week3
V1.3
2000
Week4
V1.1
1000
Week4
V1.2
1000
Week4
V1.3
1000
The matrix report displays like below. Column grows based on no of Week in the table.
Week1
Week2
Week3
Week4
V1.1
4000
3000
2000
1000
V1.2
4000
3000
2000
1000
V1.3
4000
3000
2000
1000
What I want to do now is: instead of the Count values, I need to calculate the percentage of each week over the
Count in Week1 so that each cell displays Count(Week2)/Count(Week1), Count(Week3)/Count(Week1), etc. What is the SSRS expression for that? I’m new to SSRS, Please help!Heidi,
Thank you so much for your reply and solution! Now I know how to get the first field in a group. But I can't apply your solution directly just yet because in order to explain my problem I simplified my data structure. My real data structure has a nested
group like this:
Week VersionMajor VersionMinor Count
Week1 V1 V1.1 2000
Week2 V1 V1.1 1500
Week3 V1 V1.1 800
Week1 V1 V1.2 1000
Week2 V1 V1.2 500
Week3 V1 V1.2 200
Week1 V1 V1.1 2000
Week2 V1 V1.1 1500
Week3 V1 V1.1 800
Week1 V1 V1.2 1000
Week2 V1 V1.2 500
Week3 V1 V1.2 200
Here is the query for the above data:
SELECT 'Week1' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 2000 AS Count
UNION ALL
SELECT 'Week2' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 1500 AS Count
UNION ALL
SELECT 'Week3' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 800 AS Count
UNION ALL
SELECT 'Week1' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 1000 AS Count
UNION ALL
SELECT 'Week2' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 500 AS Count
UNION ALL
SELECT 'Week3' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 200 AS Count
UNION ALL
SELECT 'Week1' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 2000 AS Count
UNION ALL
SELECT 'Week2' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 1500 AS Count
UNION ALL
SELECT 'Week3' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 800 AS Count
UNION ALL
SELECT 'Week1' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 1000 AS Count
UNION ALL
SELECT 'Week2' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 500 AS Count
UNION ALL
SELECT 'Week3' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 200 AS Count
And my matrix table looks like this:
What I need to do is to calculate the percentage of each week over week1 for
1) V1 Total
2) V1.1
3) V1.2
I can't use your solution directly because I need to apply Sum function for each cell and the Sum function gives me error when I try to use it on the denominator
First(Fields!Count.Value,"VersionMinor"). If you could help me further to get to the final solution, I'd really appreciate it!!
Happy New Year! -
YTD and accumul. depreciation have the same value when dpis is 2 years ago
Hi all
I am using FA and i have some problems. I have just setup this module and now i want to migrate assets in the system. The customer gave me an excel with the following fields that want to be in the system like: asset cost, accumulated depreciation, date placed in service, ytd accumulation and so on.
the problems are:
1) when i want to enter new asset manually the ytd depreciation and accumulated depreciation are required to be equal. ok so far, i register new asset on test environment and when i enter the date placed in service for example two years ago (because that is the real date placed in service of the asset) and run depreciation, the system has calculated correctly the accumulated depreciation, but has calculated the same value even for YTD depreciation which is not true, because in this case accumulated depreciation and ytd depreciation are completely different. how to solve this problem? How can i put correct values in this fields?
2) when i enter these assets directly in the fa_mass_additions table according to the fixed assets user guide, i have the following errors: when i put "ON HOLD" on queue name, and open these assets on the system, the on hold field has no value (is empty)
When i try to run post mass additions, the report is not finding the parameter (book) because the system is giving en error message telling me that there is no value in this list of values
please help to solve this problems because i am not being able to migrate assets for the company.
Thank you and best regardsgaskins,
You may have different Color Settings, and if you use Pantone you should be aware that the whole interpretation has changed (a number of times, most radically recently).
If you say more, more can be said.
Maybe you are looking for
-
I saved a PDF doc in adobe and then added text to the form. But every time I try an email it it only sends the original form without text. Once I've changed a doc in Adobe, how can I save it so that I'm able to use it with added text and notes? Also,
-
I tried erasing all the music on the phone, and putting it back. When I plugged in my headphones yesterday to listen to music while doing the dishes, and then pressed the button on the headphones to start the music, a song that I didn't add to my ph
-
Using Apple ID Balance with Family Sharing Enabled
I currently have 4 Apple accounts setup within my Family Sharing settings. All four are setup to use a shared payment method from my account. My primary account has a balance, yet any purchase made from a family member only uses the credit card. O
-
Split clip of a picture in picture
Question, When using picture and picture or a cutaway, I would like to split the top part into sections. Using the split clip command on it splits the lower main video, but not the one on top. I am attempting to edit video from 2 cameras of the same
-
WAD creating template from 0QUERY_TEMPLATE
Hi, has anyone got any "how to" for creating Web Templates modifying (a copy of) 0QUERY_TEMPLATE ? Thank you, Cristina