Measures based on Count

I would like to find out the total number of counts in a table based on a condition (Gender = 'F' or 'M'), I can do this in SQL.
I would like to model a simple BMM layer to create two measures 1. Male Count 2. Female Count; but not sure how to do this.
Here are the queries:
1. select post_code , count(gender) AS MALE_COUNT from balances_f where gender = 'M' group by post_code;
2. select post_code , count(gender) AS FEMALE_COUNT from balances_f where gender = 'F' group by post_code;
Appreciate any help.
Thanks
B

Create two new columns Male Count and Female Count and in the formula , use like this
case when Gender = 'F' then 1 else 0 end
( For Female Count )
and
case when Gender = 'M' then 1 else 0 end
for Male count.
Edit :- Kart has provided the answer. Please mark his answer as correct if this works for you.
Edited by: PanSa on May 19, 2010 9:26 AM

Similar Messages

  • ConditionSortStep with measure based sorting

    Hi,
    i have problem with ConditionSortStep with measure based sorting.
    I use this code :
    Selection sel = query.findSelection(dimensionID);
    OlapQDR qdr = new OlapQDR(measureDim.getUniqueID());
    qdr.addDimMemberPair(dimTime.getUniqueID(),"YR2004");
    qdr.addDimMemberPair(dimPartner.getUniqueID(),"PLUS");
    ConditionSortStep stepM = new ConditionSortStep(dimensionID, sel.getHierarchy(), ConditionSortStep.MEASURE,ConditionSortStep.DESCENDING, measure.getUniqueID(), qdr);
    SortSpec sortSpec = new SortSpec();
    stepM.setAction(Step.ADD);
    sortSpec.addConditionSortStep(stepM);
    sel.setSortSpec(sortSpec);
    query.applySelection(sel);
    Members are sorted by measure, but only descending not in hierarchical ordering. When i change hierarchy in ConditionSortStep to (String)null, I get same result.
    I mean, the specified hierarchy in ConditionSortStep is not used, but I dont know why. Any ideas?
    BIBeans 9.0.4 - JSP
    DB 9.2.0.5 + OlapB patch
    Thanks...
    maddox

    Hi David,
    Sorry for not providing proper information.
    This is my Star Schema. Dim_cutomer, Dim_problem, Dim_geo, Fact_ticket.
    Dim_cutomer: Contians information about the Cutomer, account, Install Date, Install flag
    Dim_problem: Problem type, Problem group
    Dim_Geo: is Geographical dimension. like Division, Region ...
    Fact_ticket: Has the information about the each ticket.
    The requirement is to create a report based on division, region : 1. count # of Open ticket 2. Count # of closed ticket 3. % of Failure
    I am able to do count of Open and Close. but for % failure which is tricky and complecated. To calculate the % of failure
    Failure = Count of (FAI tickets) / Count of Installs.
    to count fai: there is flag in fact i can count the FAI, Installs : count of install falg which is in Dim_customer, i can count it in report. The problem is this report have prompts like Type of account, type of problem.
    As per the client, when i change the value of problem type the count of Installs should not changed & when i change the value of Type of Account value of Installs should change based on type of account. I dont no how to control this.
    As all the dim are joined with fact.
    It will be great help if some one give some hit or help...
    thanks in adavance
    Regards
    @li

  • How to filter a report based on count?

    Here is my scenario: We would like to report activities on a server if there are multiple date in a month. Here is an example:
    Server Date Activity
    Server1 7/1/09 Hardware maintenance
    Server2 7/1/09 Hardware maintenance
    Server2 7/14/09 Software patching
    Server2 7/14/09 Server reboot
    Server3 7/5/09 Hardware maintenance
    Server3 7/5/09 Server reboot
    The report will show the following
    Server2 7/1/09 Hardware maintenance
    Server2 7/14/09 Software patching
    Server2 7/14/09 Server reboot
    Server1 and Server3 will not show up since there is only one date in July (even though there are two activities for Server3).
    I thought of using a report as a filter to a second report. In the first report, find a way to determine which server to report on. But how would I finter the 1st report based on count as the logic stated above?

    Hi Max
    Our requirement is to see all the activities for a server in a month ONLY IF there are activities on DIFFERENT dates. So using my example, server2 has activties on 7/1 and 7/14. Then we want to see all the activities for server2 in that month. Server3 has two activities but both activities are on the same date. So we don't want to see server3.
    Counting by server will not work because that will include server3 in my example.
    What I really want is to be able to count unique occurrences of dates per server in a month. And if this count is > 1, then this server will be in the report.
    I used a pivot table to count the unique occurrences of dates by server by month. So using my example, I have this result:
    Server1-July: 1
    Server2-July: 2
    Server3-July 1
    What I really want (conceptually) is to be able to filter this pivot table by the matrix column which is the count. I just couldn't figure out how to do that :). Then I thought I could use this report (with pivot table result) as a filter into another report.
    Hope you have some idea....:)
    Thanks

  • How to control the measure based on the related dimension.

    Hi Experts,
    In order to improve performance, I have created three kinds of time tables in DB,such as Year .Month, Day.
    Then import them into the physical layer in RPD, and combine them into one dimension in BMM.
    Actually, it has three level fact related with three time tables,so they are also dragged into one fact in BMM,and one column will be corresponding with three column derived from different Fact table in physical layer.
    So I want to know how to control the measure based on the related dimension.
    For example:
    when users drag the Year,Sales column, it will come from Year Dimension and Year Fact Table.
    when users drag the Month,Sales column, it will come from Month Dimension and Month Fact Table.
    when users drag the Day,Sales column, it will come from Day Dimension and Day Fact Table.

    Hi,
    Create a dimension Hierarchy, with Year >> Month >> Day Levels and
    Next Double click on Year Table LTS >> click on Ocntetnt Tab >> set as Year
    same way for Month LTS and Day LTS.
    So now when you select year column then server canknow which LTS to hit and Hits Year LTS.
    Mark If Helpfu/correct
    Thanks.

  • Diffrence between Measuring point and Counter

    What is the difference between Measuring Point and Counter ?
    -Md

    Hi,
    _Measuring Point_
    Measuring points in the SAP System describe the physical locations at which a condition is described, (for example, Temparature and Pressure on a Boiler ). The characteristics associated with the measuring points which record the value can only be numeric characteristic. Measuring points are located on technical objects, in other words, on pieces of equipment or functional locations. For every measuring point there should be some characteristics to measure the reading.
    To enable you to differentiate more easily between the individual measuring points and provide them with a unit, you assign each measuring point to a characteristic.
    The parameters like Running Hours, Temperature, Pressure etc,, on equipments can also be mapped under measuring point.
    Counter:
    A type of measuring point, where a continuous reading is recorded (e.g. Milometer). In case the measuring point is a counter, it needs to be defined likewise.
    Counter readings are taken at counters at particular intervals and in particular measurement units.
    For Example, counter readings for kilometers driven or electricity used
    Regards,
    Krishna Mohan.

  • Modify Cycle Set sequence based on counter outcome

    Dear Experts,
    I have a question with relation to multiple counter plan. We have a scenario where we have 3 cycles based on time and one based on counter. Now the requirement is, when the counter crosses a particular value - for example - if we consider failures - and the equipment fails 3 times, we have to restart the sequence from the beginning, or in other words, the day of performing maintenance based on counter should become the new Start date of the plan/ cycle set.
    Also the other thing is, the number of failures need not be regular - so we should not get any maintenance calls for the same.
    I tested different options in multiple counter plan, but I dont see a standard solution for the above scenario.
    Has any of you come across such scenarios? And do you have a solution?
    Regards,
    Veera

    Dear Pete,
    I have proposed the same solution to business - around the time I posted this query. I was about to leave, when I saw replies from you and Mahesh.
    Thanks. I am marking yours as the answer, as I feel that we don't have any other alternative.
    By the way, Mahesh, you are correct, we cannot maintain multiple time based and performance based alternatives in multiple counter plan. Also, the problem for prediction, is that the plan depends on annual estimate to give a call, and in practical circumstances, will not be able to predict the performance based counter unless it has daily entry.
    But what we can maintain is a sequence of activities on time or performance, based on the cycle set sequence.
    Regards,
    Veera

  • Replace equipment/assembly based on counter reading

    Dear PM gurus,
                        I have a scenario wherein based on counter reading we have to replace an equipment/assembly. Please help me counter the scenario,
    Thanks,
    Sunanth V.Narayan

    Hi,
    you need to attch serial no. profile to assign to the material master. you can not attach equipment in the component tab, only materials are allowed to select. so make your equipment an instance of a material first (by either generalistaion- construction type and assigning serial no. profile) and then assign it to the component tab, it will work.
    Regards,
    Lucky
    Edited by: lucksoni87 on Nov 18, 2011 2:49 PM

  • Report using Tabular Model and Measures based on Distinct Counts

    Hello,
    I am creating a report that should present something like this:
    YEAR-1 | MONTH-1 | MONTH-2 | MONTH-3... | YEAR | MONTH-1 | MONTH-2 | MONTH-3...
    My problem is that when designing the dataset to support this layout I drag the Year, Month and Distinct count Measure, but on the report when I want the value for the YEAR level I don't have it and I cannot sum the months value...
    What is the best aproach to solve this? Do I really have to go to advanced mode and customize my MDX or DAX? Can't basic users do something like this that seems so trivial and needed?
    Thank you
    Luis Simões

    Hi Luis,
    According to your description, you create a Reporting Services report using Analysis Service Tabular Model as the datasource, now what you want is sum the months value on year level, right?
    In your scenario, you can add the Month field to column group, add a parent group using Year Field and then add a Total on Month group. In this case, Reporting Services will sum the months value on Year level. I have tested it on my local environment, the
    screenshot below is for you reference.
    Reference:Lesson 6: Adding Grouping and Totals (Reporting Services)
    If this is not what you want, please describe your dataset structure, so that we can make further analysis.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Generate an Event based on Counter Trigger

    Hello,
    I have the following part that is already working: a counter (used for period measurement) which is triggered by a digital input. After that I'm reading the data and I'm puting them in a Queue. Here I get an error. The Enqueue Element Vi is providing an error. (Error 1, something with a @  character that is illegal). I've notice that if I disable the trigger for the counter I don't get the error. I'm thinking that this is cause by the delay between the moment in which the Enqueue Block tries to enqueue and the moment in which the counter provides something to its ouptut.
    What I want to do is to Generate an Event based on the Counter Trigger Signal and to put all the reading and Enqueue part in an Event Structure. I've tried to do that using an Export Signal - Property Node, but I didn't manage to make it work.
    If you have any solution for this (with or without events -  I just want to get rid of that error) please let me know.
    PS: I have Labview 8.5.1 and the USB-6210.
    Thanks,
    LostInHelp

    Hello Mike,
    Thanks for your replay.
    I've attached two vi files. In one you can find how I've tried to generate an event based on the counter trigger (test.vi).
    The second one (test1.vi) is the vi where I get the queue error. I've deleted from the second vi the part where the data are dequeue and handled.
    Thanks
    LostInHelp
    Attachments:
    test41.vi ‏50 KB
    test110.vi ‏35 KB

  • Measuring frequency with counter or analog input?

    I have some frequencies which I need to measure. Some signals are digital and some are analog.
    I have a PXI-6040E DAQ which has both counters and analog inputs. 
    I heard that you can measure higher frequencies with the counters than with analog inputs.
    What is the range of frequencies an analog input can determine versus a digital counter? 
    Where is the cutoff that you must absolutely use a digital counter to determine the frequency?
    Is the cutoff different for different DAQ cards? Or is generally the same.

    Have you looked at the specs for the device? The max sample rate and the max counter input will be listed there. The max frequency for an analog input is based on nyquist sampling theory. Are you at all familiar with? It states your sampling frequency has to be at least twice the frequency you are measuring.
    Since each device might have a different max sample rate, your last question is answered.

  • Measurement point and counter SAP PM

    Hi SAP Guru
    I've one scenario in which we've to input counter reading smaller than the previous reading
    and some times bigger reading than previous reading for a single counter.
    It is because single counter is for Energy Meter which sometimes shows bigger value and sometimes shows lesser value in case of shutdown at plant.
    Please let me know asap - is it possible for a single counter to accept bigger value one time and next time smaller value ?
    We can't make two counters for a single equipment.
    Regards
    Pooja

    Try using the counter as a measurement point.   Unclick the box measurement point is a counter and set the upper and lower tolerance settings on the details page.  The meter is not a counter but a gage.  as long as the gage reads between the upper and lower tolerances you are good.     If the gage reads out of tolerance designate a warning or an error.  You can also set it up through a user exit to produce a notification or a work order for out of tolerance readings.  See Condition Based Maintenance. -Rich

  • Combining different measures based on different dates in a single table

    Hi,
    I'm attempting to produce a report that gives two counts of items in a database, the first based on the date added to the database, the second based on the date marked as deleted, all reported by month over the last 12 months.
    The following pertinent fields are available for use in the query builder:
    Item ID, Entry Date, Deleted Date, End date of previous month, End date of previous month last year.
    The report should look something like this:
    Month.....Total Items....Additions....Deletions
    May 08....54.............. 43...............3
    Apr 08.....654..............600.............0
    Mar 08.....654..............0................0
    Feb 08.....654.............10...............10
    Jan 08.....53................0................601
    Jul 08......96................3................2
    Jun 07.....46................4................54
    Month:
    =If(DaysBetween([Last Day Of Prev Month Prev Year];[Entry Date])>0;
    +Month([Entry Date]) + " " + FormatNumber(Year([Entry Date]);"####");+
    "Previous Balance")
    Total Items:
    =RunningSum(Count([Item Id]))-RunningSum(Count(Item ID) Where(Not(IsNull([Deleted Date]))))
    Item Additions:
    =Count([Item ID])
    Item Deletions:
    =Count([Item ID]) Where(Not(IsNull([Deleted Date])))
    The part I'm having problems with is splitting the results by month, such that the number of deletions equals the number of items deleted that month, rather than the number of items deleted that month of the items added that month. I.e. I need to split by month on the additions date for the additions column and by month on the deletions date for the deletions column.
    At the moment, if the 54 items deleted in Jul 07 were originally added to the DB in, say Mar 06, then they would show up as deletions in Mar 06 - because the Month column is being split out based on Additions date. Of course I could reverse this and split the months out by deletion date, but then I would have the same problem in reverse - I can't see any way of doing both.
    Any ideas?
    I hope I've explained that so that it makes vague sense, please ask if it doesn't!
    Many thanks in advance,
    Steve

    Have you tried splitting this out into 2 seperate queries the first to return the additions by month and the second to return the deletions by month. You should then be able to merge the date dimensions and report both additions and deletions against a single date dimension.
    Regards,
    Mike

  • Service order creation based on counter reading assigned to the Ibase.

    Hi All,
    I've created a service contract (ZXXX) with the item category (ZIT1) of service plan.
    In the item category (ZIT1) definition i've copied the standard item cat. of service plan (SPLA) and assigned the standard date profile SERVPLAN to the item category.
    Requirement - Service order has to be created automatically if the counter reading assigned to the Ibase is greater than counter reading that is maintained in the service plan template that is assigned to the service plan product(Item) in the service contract transaction.
    Master Data -
    Service Interval Template - Created service plan template for counter based interval and maintained the interval as 100HR.
    Assigned the template to service plan product(item) which is assigned in the service contract.
    Created a counter ID and assigned the counter to the Ibase.
    In the item date profile SERVPLAN , I've assigned the date rule (Planned time based on the counter reading) to 'Release date' date type.
    In the item action profile ., Action is defined as it should create a service order (ZSER) with the template defined in the item if the (Release date =< today's date) as start condition.
    I've maintained the complete master data.
    Now Release date should be picked based on the counter reading of the Ibase assigned to the service plan item in the service contract.
    If Ibase counter reading > counter reading maintained in the interval the release date = todays date.
    If Ibase counter reading < counter reading maintained in the interval the release date = future date.
    which is not happening now in my case. service order is getting created even the counter reading of Ibase is less than the interval.
    Please let me know if further more changes to be done to map the scenario.
    Thanks
    Syam

    Hello,
    I found the following:
    If you fill someting in the fields REFOBJ_IBASE, this value is being converted into a GUID internally
    This happens in function CRM_BSP_OIC_1O_SEARCH_FROM_RF
    So you have to make sure that the search field REFOBJ_IBASE points towards the field CRMD_SRV_REFOBJ~GUID_OBJECT ( via table CRMC_REPDY )
    And even then I have the impression it only works when you only fill the Ibase in the order. When you fill the component there is a different GUID.
    In my case I found out it is even more complex, so I will need to create my own search field (extend search structure )
    Regards,
    Erwin

  • How to measure the exact count of your podcast downloads

    Hi,
    While their are many ways to measure podcast preformance (e.g. Feedburner account and reviewing server logs), the only way to know accurately how many episodes being downloaded is to measure the daily bandwidth consumption of your MP3 or MP4 folder.
    Look for the section titled "Average data transferred per day" within the your ISP server logs control panel, and divide that number by the average size of your episodes to determine your download count.
    If you don't want to estimate your episode lengths, do like I do and standardize your podcasts to 1.5, 5.00, 10.00, 15.00, and 20.00 minutes long.
    The above is an overview; for the details just ask.
    Mitchell A.
    Creating Success podcast Interviews with successful, creative people.
    G4   Mac OS X (10.3.9)  

    Hi Mike,
    I never said my technique would state how many listeners one has. This technique is for knowing how many episodes are being downloaded.
    Using Analog WWW logfile analysis, I set up the "File Size Report" section to subdivide download requests into size categories that correlate to my episode sizes (e.g. 10MBs). From there it's simply a matter of looking at the server requests for each category to the know how many downloads I had during any twenty-four hour period.
    Btw: I verify results by comparing total episode throughput with "Average data transferred per day."
    Mitchell A.
    Creating Success podcast Interviews with successful, creative people.

  • Page display based on count of records

    Hi All,
    i have one report requirement in BIP.
    my report should contains 3 pages only.
    Fist page contains first contact information.
    Second page should contain Second contact inforamtion.
    Third page should contain comparing of first contact age and second contact age.
    if we select first contact record it should display first page contact info only no need to display compare page.
    if we select two contacts then it should display first contact page, second contact page and compare contact age page also. (here first contact and second contact columuns should match. example address, country but age not required to match)
    if we select three or more contacts they should get a message please select two contact records only message.
    Now my question is regarding to page displays, how can we count records then display first page, otherwise display all pages, else message. Here i want to generate report with sub template logic.
    Thanks,
    jag
    Edited by: user7498756 on Aug 30, 2012 8:45 AM

    as you were saying they will select the option so in your template
    use if condition based on user input to execute the block you need .
    if selected value = first member
    call subtemplate first part
    end if
    if selected value = second member
    call subtemplate second part
    end if
    if selected value = more than 2
    keep static message
    end if
    in subtemplate create
    2 parts of code
    first part
    will have first page logic
    second part will have
    its logic required

Maybe you are looking for

  • Recovering from 'rm -rf /var/lib/pacman'?

    Well, even after a pacman -Sy clamav still didn't want to update to the newest version that archlinux.org listed. So I deleted /var/lib/pacman and started afresh. Guess that was a really bad idea. Now pacman thinks my system is completely empty, when

  • Does N8 support TV out to non-HDTV ?

    If N8 supports TV out thru composite cables where can i get it? Solved! Go to Solution.

  • Error during adstpall.sh and adstrtal.sh  of  r12  physical satnadby

    Hi All, following errors occurs when i do stop r12 application services after creating standby of oracle r12.1.1 and login page is blank Shutting down concurrent managers for cloner ... ORACLE Password: ORACLE error 604 in FDUUID Cause: FDUUID failed

  • How to erase information on stolen iPad

    How to erase information on stolen iPad

  • Simple flex example

    I searh a basic flex example like the lesson 1 of this article http://www.adobe.com/devnet/flash/articles/video_osmf.html this code in a creationComplete handler of my application: player = new MediaPlayer(); player.source = new VideoElement( new Net