Focal Point
[CLOSED] Generate where Clause Dynamically and use of GETTOK Function

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

February 19, 2013, 03:48 AM
Mayank Agrawal
[CLOSED] Generate where Clause Dynamically and use of GETTOK Function
Hi,
I want to generate where Clause dynamically in the TABLE FILE command by extarcting date from a variable containing multiple values of date.
For Ex : '30/06/2012' OR '30/09/2012' OR '31/03/2013'
I want to interate for each date in a loop by extacting through GETTOK or any other relevant function.
Can you please help me to achieve this?

Thanks.

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


7.6.11, Windows
Excel, HTML,PDF
February 19, 2013, 05:13 AM
Dave
Mayank,

This might help:

You could first run a simple query: ( just get the dates based on the whole variable )

TABLE FILE <your file>
BY <your date field>
WHERE <your date field> EQ &VARIABLE
...
END


Then loop through these results line by line and do you're iteration here.

Much easier then trying to parse the variable.

Added bonus: any dates that are not valid will to cause problems.


G'luck,
Dave


_____________________
WF: 8.0.0.9 > going 8.2.0.5
February 19, 2013, 06:09 AM
Mayank Agrawal
quote:
your date field

Thanks for you reply.
But When I am using the GETTOK function I am getting the date in alphanumeric format. But I am not able to use that in DATEMOV function to get the beginning of Quarter date.
Its saying that Invalid argument.
Please suggest.


7.6.11, Windows
Excel, HTML,PDF
February 19, 2013, 07:18 AM
FrankDutch
There are many ways to convert a alpha string date to a smartdate.
Use the search on this forum or buy the famous book I have mentioned 1001 times before.




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

February 19, 2013, 03:59 PM
Waz
Could you explain your requirements, you did not mention anything about quarters


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

February 20, 2013, 05:17 AM
Mayank Agrawal
I want to add the rows with row hold files having same structre.
I am thinking ti use MATCH command. But no idea how to implement this.
Can you please suggest. Also if any better method available, please suggest that also.

This is my current requirement. Regarding date changes I will ask later on.


7.6.11, Windows
Excel, HTML,PDF
February 20, 2013, 02:52 PM
Waz
Sounds like you have or are going to create extra hold files and merge them.

Can you give an example of the data and hold files.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!