Focal Point
[SOLVED] Question Where/If by summed column

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/7457084036

April 29, 2013, 10:29 AM
cs_source
[SOLVED] Question Where/If by summed column
Hi, i can do this in the SQL side however i'm curious if i can do this from the Report Painter/Synonym side.

I have a list of people (Family name) and a field (e.g. has car) which marks a 0 (No) and 1 (Yes). In my report i have that has car columned summed and grouped by person. I would like to have it so that it only shows people which have that car column summed as 0 or less than 1. How am i able to do this

I find it hard to believe that i cant get this going but i know i'm missing something?

Note that i did try to create where/if clause on that has car column however that is not correct as a person (family) can have more than 1 car and the where looks at per record and not the grouped by sum.

This message has been edited. Last edited by: <Kathryn Henning>,


WebFocus 8.02, SQL Server 2008r2
April 29, 2013, 10:43 AM
FrankDutch
maybe a silly question but I suppose you have the been reading all the documentation and did some basic training?

to give you the short answer...yes you can...

table file xxx
sum "hascar"
by familyname
where hascar lt 1
end

and all this in capitals of course




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

April 29, 2013, 10:51 AM
Francis Mariani
It may need to use the WHERE TOTAL phrase:

TABLE FILE XXX
SUM HASCAR
BY FAMILYNAME
WHERE TOTAL HASCAR LT 1
END


Look at "Creating Reports With Report Painter" > "Selecting Data":

"WHERE TOTAL enables you to select records based on the aggregate value of a field. For example, on the sum of field values, or on the average of field values."


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
April 29, 2013, 10:52 AM
cs_source
Hi Frank,

Thanks for your reply, yes i did basic training and the solution you provided does not work because of the note i mentioned.

Example:
Name make has car
John Doe acura 1
Jane Doe null 0
jack johnson vw 1
web focus null 0

i want it to show
name does not have car
name make has car
web focus null 0

your solution when i applied it which is what i was doing as well just hides john doe's car of acura but shows jane doe (however i need it grouped by family) which is not correct because the family as a car so they should not show up. this is where i was saying that i believe the where/if looks at each row however can i do a where/if on a group?

I hope that clarifies my question?


WebFocus 8.02, SQL Server 2008r2
April 29, 2013, 10:54 AM
cs_source
Hi Francis,

This is exactly what i was looking for!!! Smiler thank you, i was trying to do this in report painter and couldn't figure it out.

its the Total that did it Smiler Thanks again you save me some time!


WebFocus 8.02, SQL Server 2008r2