Focal Point
[SOLVED] Choosing "ALL" on date filter

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

August 25, 2017, 11:16 AM
BSBAL18
[SOLVED] Choosing "ALL" on date filter
I have a filter on an HTML page that i have chosen "ALL" that errors with "FOC177) INVALID DATE CONSTANT: ALL" However if i click a single date IN the filter, it works just fine, but when i pick the ALL, it errors, There are only 5 dates that populate the filter, with no blanks or nulls. Can I use ALL in a date filter or do i need to uncheck "use ALL" in setup?

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


AS Version: 8201
Gen: 10202016
Windows, All Outputs
August 25, 2017, 11:24 AM
MartinY
As the "Value" in your available selection in your drop list put "ignore" and "All" as the "Display". Then the date that you want.
So at run time it will pass "_FOC_NULL" to your fex and the WHERE clause will be bypassed.

As for a static list, per example the "Setting/Input Control Populations" par of your control will be something such as this:
Value      Display
ignore     All
2017/01/01 2017/01/01
2017/02/01 2017/02/01
2017/03/01 2017/03/01


Actually, you probably have something such as this:
Value      Display
All        All
2017/01/01 2017/01/01
2017/02/01 2017/02/01
2017/03/01 2017/03/01


Have you used the static list or dynamic ?

How your WHERE is performed against the "date" parameter in your fex ?

This message has been edited. Last edited by: MartinY,


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
August 25, 2017, 11:36 AM
BSBAL18
quote:
So at run time it will pass "_FOC_NULL" to your fex and the WHERE clause will be bypassed.


Still getting error for ALL option.
Within the settings,
I have "Add ALL option" checked, and tried value ignore. The list is populated dynamically from an XML. So manual entry of dates is not configured.


AS Version: 8201
Gen: 10202016
Windows, All Outputs
August 25, 2017, 11:37 AM
MartinY
quote:
The list is populated dynamically from an XML

How the above is performed ?
How your WHERE is performed against the "date" parameter in your fex ?
Share the code if possible.


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
August 25, 2017, 11:46 AM
Wendy G
WHERE RUN_DATE_BKT_YEAR_M EQ &AR_MONTH.QUOTEDSTRING;

Pulling the data from an XML:

TABLE FILE DB_AR_DATES
BY DB_AR_DATES.DB_AR_DATES.RUN_DATE_BKT_YEAR_M AS AR_MONTH
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT XML
ON TABLE SET STYLE *
$
ENDSTYLE
END


8105
August 25, 2017, 11:54 AM
BSBAL18
Wendy G is my mentor, so she has the code understanding a lot more. We Work together, but she does all the work Smiler


AS Version: 8201
Gen: 10202016
Windows, All Outputs
August 25, 2017, 11:55 AM
MartinY
quote:
WHERE RUN_DATE_BKT_YEAR_M EQ &AR_MONTH.QUOTEDSTRING;


What is the format of RUN_DATE_BKT_YEAR_M ? Please share data sample.
Seems to be a text string because you've added ".QUOTEDSTRING" to the parameter.


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
August 25, 2017, 11:59 AM
Hallway
It looks like in your XML file, you are only bringing back one column. So in your HTML control settings, do you have the "Send display value" checked? If so that might be your problem.


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
August 25, 2017, 12:13 PM
MartinY
You can also try with the following:

SET ASNAMES = ON
TABLE FILE DB_AR_DATES
SUM DB_AR_DATES.DB_AR_DATES.RUN_DATE_BKT_YEAR_M AS 'AR_MONTH_DSP'
BY  DB_AR_DATES.DB_AR_DATES.RUN_DATE_BKT_YEAR_M AS 'AR_MONTH_VAL'
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT XML
ON TABLE SET STYLE *
$
ENDSTYLE
END


That way you tell Focus to display AR_MONTH_DSP in the list box, but send AR_MONTH_VAL as the parameter value.
But "Send display value" must not be checked as stated by Hallway.
And you can have the "Add All option" checked.


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
August 25, 2017, 01:01 PM
Hallway
MartinY is spot on!! If you were to use the code he suggests, your drop down control settings should look something like this:




Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
August 25, 2017, 03:07 PM
Wendy G
Thanks, I decided to go another direction. I removed the all and the multiple section on the filter. Then I did a sort order descending. This way they can only chose one month to report on at time. This is a very large report, so that limit is good. It also allows for the most current month to be the default if they don't chose a date. This will work for this page.

I would still like to know how to use the all function for this filter, but when I tried to match your screen shot it didn't work for me. Too many moving pieces to worry about today since I have a deadline.

I will however, try this approach in my test bed once I have time. Thank you so much for your time.


8105