Focal Point Banner


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.

New TIBCO Community Coming Soon
In early summer, TIBCO plans to launch a new community—with a new user experience, enhanced search, and expanded capabilities for member engagement with answers and discussions! In advance of that, the current myibi community will be retired on April 30. We will continue to provide updates here on both the retirement of myibi and the new community launch.

What You Need to Know about Our New Community
We value the wealth of knowledge and engagement shared by community members and hope the new community will continue cultivating networking, knowledge sharing, and discussion.

During the transition period, from April 20th until the new community is launched this summer, myibi users should access the TIBCO WebFOCUS page to engage.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED]How to show Records when they don't exist

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]How to show Records when they don't exist
 Login/Join
 
Member
posted
Hi,
Hoping this is an easy one..
I defined a field in car file called
SEATSA, it is simply spelling out each of the seats:
SEATSA/A5=IF SEATS EQ 2 THEN 'TWO' ELSE IF SEATS EQ '4' THEN 'FOUR' ELSE 'FIVE';

I now want to count seats BY CAR BY SEATSA, but I want to see all of the SEATSA values for each CAR.
For example for Alpha Romeo I want to see FIVE count 0, FOUR Count 1, TWO Count 2.

Here is my code:
DEFINE FILE CAR
  SEATSA/A12=IF SEATS EQ 2 THEN 'TWO' ELSE IF SEATS EQ '4' THEN 'FOUR'  ELSE 'FIVE';
END
TABLE FILE CAR
SUM CNT.SEATS
BY CAR
BY SEATSA
WHERE CAR EQ 'ALFA ROMEO';
END  


I am not getting the value of FIVE of course, since 5 does not exist for Alpha Romeo.
How do I show FIVE and have a count of 0?

Thank you.

This message has been edited. Last edited by: nickz,
 
Posts: 12 | Registered: September 13, 2019Report This Post
Gold member
posted Hide Post
Hi Nick,
You could try something like this.

DEFINE FILE CAR
  SEATS_2/I2= IF SEATS EQ 2 THEN 1 ELSE 0;
  SEATS_4/I2= IF SEATS EQ 4 THEN 1 ELSE 0;
  SEATS_5/I2= IF SEATS EQ 5 THEN 1 ELSE 0;
END
TABLE FILE CAR
SUM CAR NOPRINT
    SEATS_2 AS 'TWO'
    SEATS_4 AS 'FOUR'
    SEATS_5 AS 'FIVE'
BY CAR
END

 
Posts: 90 | Location: Oklahoma City, Oklahoma | Registered: July 01, 2010Report This Post
Silver Member
posted Hide Post
nickz, can you try this if it works for you?

 
SET NODATA = 0

TABLE FILE CAR
SUM CNT.SEATS
BY CAR
BY SEATS AS 'SEATS' ROWS 2 AS 'TWO' OVER 3 AS 'THREE' OVER 4 AS 'FOUR' OVER 5 AS 'FIVE' 
WHERE CAR EQ 'ALFA ROMEO';
END 
 


Thanks,
Pku

Focus, WebFocus 8201 on Windows
 
Posts: 43 | Registered: May 28, 2008Report This Post
Member
posted Hide Post
Thank you Pku,
This solution is exactly what I was looking for.
 
Posts: 12 | Registered: September 13, 2019Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED]How to show Records when they don't exist

Copyright © 1996-2020 Information Builders