Focal Point
[SOLVED] Extracting specific value/word from a field

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

December 06, 2018, 10:45 AM
Gagan Marwah
[SOLVED] Extracting specific value/word from a field
Hello,

I am trying to find a function that will let me extract a given word from a field. The report I am creating needs to indicate if the incident was critical, high, moderate, etc. This information is indicated in a field called notes, where users input what the issue was and whether it was critical, high, low or moderate incident. For example: The issue was caused by Server upgrade last night, which caused some of the applications to go down. This resulted in a critical incident as we had to get the person on call to remediate the issue. I am only after "critical" incidents. Is there a way I can extract the word critical from the notes field?


Thanks for your help in advance!

Regards,
Gagan

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


WebFOCUS 8
Windows, All Outputs
December 06, 2018, 10:49 AM
BabakNYC
There are a lot of functions that can be used. One of them is position.

https://webfocusinfocenter.inf.../source/position.htm


WebFOCUS 8206, Unix, Windows
December 06, 2018, 11:07 AM
Danny-SRL
Gagan,
If I understand you correctly, you only want to know if the field "notes" contains one of the following, critical, high, low or moderate, and maybe a few more.
Do you also want to know which of these, maybe in order to sort by the value?
If so, I would create a DEFINE field:
 
DEFINE FILE fff
INCIDENT/A12=IF NOTES CONTAINS 'critical' THEN 'CRITICAL' ELSE 
             IF NOTES CONTAINS 'high' THEN 'HIGH' ELSE
             IF NOTES CONTAINS 'low' THEN 'LOW' ELSE
             IF NOTES CONTAINS 'moderate' THEN 'MODERATE' ELSE 'NONE';

Then in your TABLE request you can screen and sort with INCIDENT.


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

December 06, 2018, 04:38 PM
Gagan Marwah
Daniel,

You understood correct! That worked like a charm.

Thank you both for your responses.

Best,
Gagan


WebFOCUS 8
Windows, All Outputs