Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

counting partial result

Featured Replies

Hi everybody, please I need tips to solve this problem :(

in the table you can see the partial result of search operation operated on "serial" field.

 I need to have partial count in the field "tipo" for each "E", "R" "N" type, how many they are?

I tried relation, i tried to count partial, but i not solve it out.

please can anybody suggest me out to fix?

 

 

 

1.png

2.png

I need to have partial count in the field "tipo" for each "E", "R" "N" type, how many they are?

The simplest way is to use a summary field defined as Count of [Seriale] (or any other field that cannot be empty). Sort the records by Tipo, and show the counts in a sub-summary part.

  • Author

thanks for answer, but i need to see on the top "how many type "E" have been found .

what I  am not able to do is to count how many  "E" in the field Tipo   ( search by serial I.e. )

You can use this Custom Function called "CustomList:

http://www.briandunning.com/cf/868

and then define a field that uses the ExecuteSQL function:

E_Count  = (Calculation, Number Result, Unstirred) =

Let([

a = "'" & Substitute(CustomList ( 1 ; Get ( FoundCount ) ; "getnthrecord ( dwdcSample::seriale ; [n] )" ); "¶"; "','") & "'";

b = ExecuteSQL ( "SELECT count(*) FROM databasetubi WHERE tipo = 'E' AND seriale IN (" & a & ")" ; "" ; "" ; "" )

];

b

)

Place this field at the top of your list. This calculation will adapt to your found count. 

Hope this helps!

  • Author

thanks for your answer, maybe can help, but i m not able to apply sorry, can explain me hot to insert this function in the field? keep on receive error " no field" 

Here is a sample file.  You will need to define a "Custom Function". Look at the ONLINE HELP for instructions on how to do that.

Hope this helps!

dwdcSample.fmp12

Here is a sample file.  You will need to define a "Custom Function".

With FM13 and newer, you could use a summary field “ListOf: primaryKey”, rather than a CF, to restrict the query to the found set.

Edited by eos

  • Author

@dwdata

thanks thai is exactly what i need, now i need to understand how you did it :) I want to learn ! thanks a lot.

 

 

@eos

your solution works fine too, I want learn yours too. Thanks for support buddy

 

thanks a lot

Edited by Marcus69

  • Author

@dwdata

sorry to bother you again buddy, but the calculation field for E count:

Dichiara([

a = "'" & CercaeSost(CustomList ( 1 ; Get ( ContoTrovati ) ; "getnthrecord ( seriale ; [n] )" ); "¶"; "','") & "'";

b = EseguiSQL ( "SELECT count(*) FROM databasetubi WHERE tipo = 'E' AND seriale IN (" & a & ")" ; "" ; "" ; "" )

];

b

)

 

report the function CustomList does not exist, and do not allow me to proceed. I check all FM and i did not find where to call for this function can you give me a tip please?

 

Since you are on FMP13 (according to your profile), here is revised version of my sample file (that does not use the custom_list () custom function. It uses the ListOf type for a summary field.

Hopefully you can get this working.

dwdcSample2.fmp12

  • Author

you are the man, it works great even on my file, i m studying what u wrote, i want too learn... thanks so much !

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.