As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
Normally I'd do four COMPUTES, a HOLD and then use the computed fields from the HOLD file in another COMPUTE, but for various reasons I have to do this in a single pass.
Ideas?
Cheers,
JoeyThis message has been edited. Last edited by: Kerry,
-WebFOCUS 8.2.01 on Windows
Posts: 318 | Location: Los Angeles, CA | Registered: November 15, 2005
Sadly, I can't use this suggestion, and here's why. This is not so much a WebFOCUS issue as a PMF issue that involved FOCUS code. Here's the background:
PMF measures allow you to type FOCUS code when setting table and field mappings. So, you pick a data source, choose your dimensional keys to join on and then define the fields to use for Actual, Target, Forecast, Benchmark. Instead of choosing a particular table field, you can create a COMPUTE. However, anything that you want to map to a PMF field needs to happen in a single COMPUTE, which is why I can't use the technique you provided.
I think I dug my own hole on this one guys, and will have to tell my client I can't actually build this particular measure. Oh well.
Cheers,
Joey
-WebFOCUS 8.2.01 on Windows
Posts: 318 | Location: Los Angeles, CA | Registered: November 15, 2005
@Was: This has crossed my mind, but the issue is that I don't need the results of a nested IF statement so much as I need to compare the results of four IF statements against each other.
@Dan Satchell: I wondered about some kind of dblookup function, but... I do remember some tech memo about a define in a masterfile that does a query. Is there some kind of FOCUS function that can embed an entire TABLE request? Something like:
Essentially I need to bang everything into one request, although now that I think about it, I do have the capability to add fields to the masterfile. Hmmm..... I wonder about making four defines with the IF..THEN...ELSE... logic and then mapping to those fields as if they were real. This might work.
Cheers,
Joey
Posts: 318 | Location: Los Angeles, CA | Registered: November 15, 2005
-SET &RptNum = IF &RptType = 'ORGDETAIL' AND &STORE_DIV_NUM EQ 'FOC_NONE' AND ®ION_NUM EQ 'FOC_NONE' AND &DISTRICT_NUM EQ 'FOC_NONE' THEN 1 ELSE
- IF &RptType = 'ORGDETAIL' AND &STORE_DIV_NUM NE 'FOC_NONE' AND ®ION_NUM EQ 'FOC_NONE' AND &DISTRICT_NUM EQ 'FOC_NONE' THEN 2 ELSE
- IF &RptType = 'ORGDETAIL' AND &STORE_DIV_NUM NE 'FOC_NONE' AND ®ION_NUM NE 'FOC_NONE' AND &DISTRICT_NUM EQ 'FOC_NONE' THEN 3 ELSE
- IF &RptType = 'ORGDETAIL' AND &STORE_DIV_NUM NE 'FOC_NONE' AND ®ION_NUM NE 'FOC_NONE' AND &DISTRICT_NUM NE 'FOC_NONE' THEN 4 ELSE
- IF &RptType = 'DEPTDETAIL' THEN 5 ELSE
- IF &RptType = 'DRILL' AND &DrlFrm EQ 'ORG' AND &RptNum LE 8 THEN &RptNum + 1 ;
OR:
-IF THIS1 EQ THAT1 THEN 1 ELSE
-IF THIS2 EQ THAT2 THEN 2 ELSE
-IF THIS3 EQ THAT3 THEN 3 ELSE
-IF THIS4 EQ THAT4 THEN 4 ELSE
ETC ...
I think this is limited to 16.
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005
I went down the path that Dan Satchell suggested, and it seemed to be going well for a time. I built my four fields as DEFINES in the masterfile, and they work well. However, when I try to make DEFINES for dividing them by each other, I get some oracle error about dividing by zero. If I do the same process as a COMPUTE using the divided fields, it works as desired. The strange part is that if I do the division in PMF's single mapping field, it only loads zeros. I am able to do other calculations, such as subtractions in PMF and that flows through. I'm going to take this to the PMF forum, as I think this might be the end of the WebFOCUS specific part of my question.
Thank you for your help.
Cheers,
Joey
Posts: 318 | Location: Los Angeles, CA | Registered: November 15, 2005
DEFINE FILE CAR
A/D5.2 WITH COUNTRY = 5 ;
B/D5.2 WITH COUNTRY = 6 ;
C/D5.2 WITH COUNTRY = 7 ;
D/D5.2 WITH COUNTRY = 8 ;
MYVAL/D12.2 =
IF A LT 0 THEN (
IF B LT 0 THEN (
IF C LT 0 THEN (
IF D LT 0 THEN ((A+1) / (B+1)) - ((C+1) / (D+1))
ELSE ((A+1) / (B+1)) - ((C+1) / (D-1)) )
ELSE (
IF D LT 0 THEN ((A+1) / (B+1)) - ((C-1) / (D+1))
ELSE ((A+1) / (B+1)) - ((C-1) / (D-1)) ) )
ELSE (
IF C LT 0 THEN(
IF D LT 0 THEN ((A+1) / (B-1)) - ((C+1) / (D+1))
ELSE ((A+1) / (B-1)) - ((C+1) / (D-1)) )
ELSE (
IF D LT 0 THEN ((A+1) / (B-1)) - ((C-1) / (D+1))
ELSE ((A+1) / (B-1)) - ((C-1) / (D-1)) ) ) )
ELSE (
IF B LT 0 THEN(
IF C LT 0 THEN(
IF D LT 0 THEN ((A-1) / (B+1)) - ((C+1) / (D+1))
ELSE ((A-1) / (B+1)) - ((C+1) / (D-1)) )
ELSE (
IF D LT 0 THEN ((A-1) / (B+1)) - ((C-1) / (D+1))
ELSE ((A-1) / (B+1)) - ((C-1) / (D-1)) ) )
ELSE (
IF C LT 0 THEN(
IF D LT 0 THEN ((A-1) / (B-1)) - ((C+1) / (D+1))
ELSE ((A-1) / (B-1)) - ((C+1) / (D-1)) )
ELSE (
IF D LT 0 THEN ((A-1) / (B-1)) - ((C-1) / (D+1))
ELSE ((A-1) / (B-1)) - ((C-1) / (D-1)) ) ) ) ;
END
-RUN
TABLE FILE CAR
PRINT A B C D MYVAL
IF RECORDLIMIT EQ 1
END
Change the tests to your tests, and the 'THEN' and 'ELSE' results to your computations. I used