Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6501 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi,

I'm having a problem conceptualizing an SQL query in FM.

How would you do the equivalent of a SQL Group BY and SUM in FM?

Let say I have a single table:

FILES (pkFileID, fkDayID, FileCode, WorkedTime)

pkFileID --> Primary key

fkDayID --> Foreign key

FileCode --> A Code such as "GE-TR-123"

WorkedTime --> A number which represents the work time on a file.

In SQL would do:

SELECT Files.FileCode, SUM (Files.WorkedTime) as TotalWorkedTime

FROM Files

GROUP BY Files.FileCode

This would give me a list with the amount of work time for each FILE.

How can I get the equivalent in FM?

Thank you

Posted

Look into subsummary reports. You can group by fields. Create a new columnar list/report layout and follow the wizard.

Posted

I tried all the possible ways with the wizard and I am not able to get the wanted solution. When I do grouping, how do a I get the sum?

Here is what I get:

sshot42vc6.jpg

As you can see, the total time per file is not good since it is a repetition of the summary field totalTime. And the values are not grouped.

Is it possible to create a SQL Group-by Sum? Like I posted in the first post.

Posted

Perhaps if you'd used the wizzard, you could have seen which data you needed to allocate to where and why?

But as it is should your summary field should be moved to a subsummary part, say - next to you filecode field instead of being in the body as it is on your image. Perhaps what you really want is to get rid of the body-part ...then delete it after moveing the summaryfield to it's correct location.

--sd

Posted (edited)

Thanks to both of you! It worked in the subsummary field, although I still prefer SQL method. The only thing is that I had to hide the body, since it was not useful...

sshot43ko4.jpg

Edited by Guest

This topic is 6501 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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