Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

Applying a filter to a COUNT

Accepted answer
597
Views
17
Comments

Hello,
I am new to Data Visualizer and I am using Oracle Analytics Desktop (current version).

I have a simple table with two columns and ten records (see image). I can create a table visual and apply a filter to the table successfully. But when I do a count of the records and apply the same filter, it shows no data. Where am I going wrong?
The image shows the table contents and the filter I am applying:

COUNT of.png Is Zero Filter.png

Best Answer

«1

Answers

  • [Deleted User]
    [Deleted User] Rank 7 - Analytics Coach
    edited May 29, 2024 4:32PM

    How does that calculation relate to the bottom right viz that you are presumably talking about. How are you counting what precisely?

  • Mostafa Morsy-Oracle
    Mostafa Morsy-Oracle Rank 6 - Analytics Lead

    The problem that your "CUSTOMER ID" is a dimension and not a Measure so you can try to Use CAST Function with the "CUSTOMER ID" Column to Double and re-Test your equation.

    If the source identified CUSTOMER ID As Measure your calculation will work

  • Mirithu
    Mirithu Rank 3 - Community Apprentice

    Thank you for your responses.

    @Christian Berg The count, if I was to put it in a sql statement, would be:
    SELECT COUNT("CUSTOMER ID") FROM TABLE WHERE "ORDER AMOUNT" =0;
    I would expect the result to be 3, but in this case 'No Data Found'.

  • Mirithu
    Mirithu Rank 3 - Community Apprentice

    Thank you @Mostafa Morsy-Oracle
    Do you mean something like this:

    image.png
  • Sumanth V -Oracle
    Sumanth V -Oracle Rank 8 - Analytics Strategist

    @Mirithu - Please share the calculation details currently being used to calculate count of customer ID to validate why it works for one scenario and not for the other one. Thanks.

  • [Deleted User]
    [Deleted User] Rank 7 - Analytics Coach

    @Christian Berg The count, if I was to put it in a sql statement, would be:
    SELECT COUNT("CUSTOMER ID") FROM TABLE WHERE "ORDER AMOUNT" =0;
    I would expect the result to be 3, but in this case 'No Data Found'.

    My question was "how are you counting what exactly" and Sumanth also asked you for the calculation details.

    I know what the SQL would look like. The question is how are you doing things right now? What you are doing and how you are doing decides what you are seeing. Not some theoretical SQL statement.

  • Mirithu
    Mirithu Rank 3 - Community Apprentice

    Thank you @Sumanth V -Oracle
    Actually, the calculation is simple - Get the number (count) of customers who have an order amount of zero from the given table.

    If I use a Table visual, I am able to show all customers and their order amounts, and if I apply the filter "ORDER AMOUNT = 0", I can display only the customers with zero order amounts (as in the image provided).

    The problem is when I apply this same filter to the count of customers. Using a Tile visual, I can show the count of customers - 10 in this case. But when I apply the the filter ( "ORDER AMOUNT = 0" ) to the Tile visual, it shows "No Data Found", yet I expect it to show 3 as the count.

    Here is the data I am using:

    CUSTOMER ID

    ORDER AMOUNT

    68602

    14,738.00

    38327

    0.00

    68273

    14,596.00

    31555

    13,917.00

    21718

    0.00

    21983

    7,357.00

    4576

    12,186.00

    13921

    14,985.00

    20263

    0.00

    79018

    6,960.00

  • Mirithu
    Mirithu Rank 3 - Community Apprentice
  • @Mirithu

    "If I use a Table visual, I am able to show all customers and their order amounts, and if I apply the filter "ORDER AMOUNT = 0", I can display only the customers with zero order amounts (as in the image provided). "=⇒ How are you defining this filter , can you show screenshot? If Order Amount is a measure you can only apply range/topBottomN filter.

    Thanks

    Gayathri

  • Mostafa Morsy-Oracle
    Mostafa Morsy-Oracle Rank 6 - Analytics Lead

    I make this works for you please have a look to the following

    Screenshot 2024-05-30 at 11.36.45 AM.png

    If this is what you looking for let me know and I will send you the workbook and you can use it in your project