Focal Point
[CLOSED] Filter syntax in summary(compute)

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

October 22, 2020, 09:55 PM
rthorn
[CLOSED] Filter syntax in summary(compute)
Hello everyone,

I have a project that I am working on that requires multi level filtering. I was hoping to accomplish that by including a filter argument in my two compute dimensions.

My data is mainly composed of an employee ID, their corresponding functional area, and a date time field with all a time stamp that corresponds to all actions they have performed. I am attempting to have a custom column that will have their last job function performed before break, a custom column that will have their first job function performed after break, and another column with the total time between the two previous columns.

I currently have two Detail(Define) fields that could be used for the filter argument. One returns the current time, and the other calculates the difference between the current time and any value in the date time field to give me a time dif.

This should be simple enough to execute but I have been unable to find any kind of breakdown online for how to use various syntax's in infoassist.

I currently have something like this:

MAX.WFTRHPICK.WFTRHPICK.DT_TM_START WHERE Time_Diff LE 60

& This:

MIN.WFTRHPICK.WFTRHPICK.DT_TM_START WHERE Time_Diff GE 40


If anyone can shed some light into how I could accomplish this, it would be greatly appreciated. Also, if someone know of some sort of repository of various syntax for infoassist it would be great if you could pass the info along.

Thank you for your time

This message has been edited. Last edited by: FP Mod Chuck,


InfoAssist +
WebFocus 8
October 23, 2020, 07:55 AM
MartinY
quote:
how to use various syntax's in infoassist

I may not be yet awaked, but it's not clear for me what you are attempting to do and what you mean by the above.

Can you provide your whole code, maybe include data and expected result sample ?
Include all above using the code tag which is the last icon on the ribbon that's look like the below
</>


As for to applying a filter on a COMPUTEd field, you must use the following :
WHERE TOTAL fieldToTest testCond testValue;

Or
WHERE TOTAL testFieldA testCond testFieldB;

Thanks


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
October 26, 2020, 01:49 AM
rthorn
Thank you for the reply Martin,

When I try to add total into the filter argument I still get a (FOC224) Syntax error: WHERE (FOC009) Incomplete request statement bypassing to end of command (IA_201026_012428-1)

As far as the actual code goes, I can view it in the view code button at the top of the ribbon, but am unable to edit it after it is open. It says "Current Focexec Content" at the top of the text box. I am only able to use the Summary (Compute) & Detail (Define)options on the data tab of the ribbon.
I currently have something like this:

MAX.WFTRHPICK.WFTRHPICK.DT_TM_START WHERE Time_Diff LE 60

& This:

MIN.WFTRHPICK.WFTRHPICK.DT_TM_START WHERE Time_Diff GE 40


The actual code that I can not edit is:
 HMS/HS=HHMS ( WFTRHPICK.WFTRHPICK.DT_TM_START , 8 , 'HS' ) ;
 Time_filter/D12.0=MAX ( WFTRHPICK.WFTRHPICK.DT_TM_START_YEAR_D , WFTRHPICK.WFTRHPICK.DT_TM_END_YEAR_D ) ;
 Current_Time/HYYMD.S=HGETC ( 10 , 'HYYMDm' ) ;
 Time_Diff/D12.0=HDIFF ( Current_Time , WFTRHPICK.WFTRHPICK.DT_TM_START , 'MINUTES' , 'D12.0' ) ;
END
-DEFAULTH &WF_SUMMARY='Summary';
-DEFAULTH &WF_TITLE='WebFOCUS Report';
TABLE FILE 
SUM MIN.WFTRHPICK.WFTRHPICK.DT_TM_START AS 'First_Pick'
COMPUTE lastpick/HYYMDS=MAX.WFTRHPICK.WFTRHPICK.DT_TM_START ;
COMPUTE firstpick/HHIS=MIN.WFTRHPICK.WFTRHPICK.DT_TM_START ;
COMPUTE break/HHIS=WFTRHPICK.WFTRHPICK.DT_TM_START ;
BY TOTAL HIGHEST MIN.WFTRHPICK.WFTRHPICK.DT_TM_START NOPRINT
BY WFTRHPICK.WFTRHPICK.EMP_ID
BY WFTRHPICK.WFTRHPICK.WHS_ZONE
WHERE Time_Diff LE 25;
WHERE WFTRHPICK.WFTRHPICK.WHS_ZONE EQ 30 OR 40 OR 50 OR 60 OR 80 OR 90; 


Thank you for your assistance


InfoAssist +
WebFocus 8