Focal Point
[COLSED]Conditional Row?

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

May 23, 2011, 03:08 PM
Charles Richards
[COLSED]Conditional Row?
I am trying to add a row to a table when it meets a certain criteria. When one of the current rows has a numerical value for the field "national brand" I would like a row to follow showing that ITEMs information.

Currently I made a report that only shows off brand items, Its designed to show to our customers. I would like to contain information about the national brand, if that generic ITEM has a "national brand" if it does i would like it to spit out the information about the national brand right below the information about the generic brand.

If the generic brand doesn't have a national brand its just 00000

If it does i would like to make another row filled out with the National Brand Information


EX.

________________________________(invisable col)
catalogcode____ITEMCODE___Size___NATIONAL_Brand___ Price
00001__________12345______5______00000____________1.00
......................................................
00002__________12346______8______00000____________2.00
......................................................
00003__________12347______4______00000____________1.50
......................................................
00004__________12348______5______47532____________2.50
39642__________47532______5______N/A______________3.50
......................................................
00005__________12349______3______00000____________2.00
......................................................
00006__________12350______1______37634____________3.00
34254__________37634______1______N/A______________4.00


Does Anyone know how to do conditional Rows? Or how I would be able to do this??

This message has been edited. Last edited by: Charles Richards,


WebFOCUS 7.6
Windows, All Outputs
May 23, 2011, 04:21 PM
Dan Satchell
You might be able to use SUBFOOT with a WHEN clause. For example:

TABLE FILE ...
 PRINT/SUM ....
 BY catalogcode
 BY ITEMCODE
 BY NATIONAL_Brand NOPRINT
 ON NATIONAL_Brand SUBFOOT
  "<field1<field2<etc..."
  WHEN NATIONAL_Brand NE '00000' ;
 ON TABLE STYLE *
  TYPE=SUBFOOT, HEADALIGN=BODY, $
END



WebFOCUS 7.7.05
May 24, 2011, 09:09 AM
Charles Richards
It worked and it was able to spit out data at the correct spot(up and down but not lined up with the other columns)...

I did

BY catalogcode
BY ITEMCODE
ON ITEMCODE SUBFOOT



How would I be able to retreieve the data for national brand? / Set the ITEMCODE = to the National brand( in the SUBFOOT)?



ALSO, How Can I line them up with the other columns?

This message has been edited. Last edited by: Charles Richards,


WebFOCUS 7.6
Windows, All Outputs
May 24, 2011, 01:04 PM
Dan Satchell
Add a DEFINE or COMPUTE to set ITEMCODE = NATIONAL_Brand for the SUBFOOT. The StyleSheet parameter HEADLIGN=BODY is used to align SUBFOOT columns with the data columns.

DEFINE FILE ...
 ITEMCODE_SF/A5 = IF (NATIONAL_Brand NE '00000') THEN NATIONAL_Brand ELSE ITEMCODE ;
END
-*
TABLE FILE ...
 PRINT/SUM ....
 BY catalogcode
 BY ITEMCODE
 BY NATIONAL_Brand NOPRINT
 ON NATIONAL_Brand SUBFOOT
  "<catalogcode<ITEMCODE_SF<Size<NATIONAL_Brand<Price"
  WHEN NATIONAL_Brand NE '00000' ;
 ON TABLE STYLE *
  TYPE=SUBFOOT, HEADALIGN=BODY, $
END

This message has been edited. Last edited by: Dan Satchell,


WebFOCUS 7.7.05
May 24, 2011, 01:36 PM
Charles Richards
Thank you so Much for you help!

I have one last question

How would i retrieve the catalog code and other values where the ITEMCODE = the national brand


currently it is retrieveing the value of the current ITEMCODE, I would like it to retrieve all of the values using national brand as the itemcode, How would i be able to accomplish this?

Thank you very much for all of your help!!


WebFOCUS 7.6
Windows, All Outputs
May 24, 2011, 04:17 PM
Dan Satchell
Adding more DEFINEs or COMPUTEs may solve the problem, but it is impossible to know exactly what solution will work without knowing more about the structure of your data. Are the "local" and national brand data in the same table or HOLD file? If both are in the same table/HOLD file, are related local and national brand items sorted one after the other? If the two types of data are in different tables, how are the two tables joined or merged?


WebFOCUS 7.7.05