dbTalk Databases Forums  

Re: A synonym to group data (D3/NT)

comp.databases.pick comp.databases.pick


Discuss Re: A synonym to group data (D3/NT) in the comp.databases.pick forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
MBTraining@aol.com
 
Posts: n/a

Default Re: A synonym to group data (D3/NT) - 09-17-2006 , 05:48 AM






The correct syntax is much like that in Basic programming, and the
logical test(s) you have in the correlative is incomplete

A;IF N(PRODUCT.MODEL)='A' 'B' 'C' 'D' THEN '1' ELSE '2'

What you have to write is something like

A;IF N(PRODUCT.MODEL)='A' OR N(PRODUCT.MODEL)='B' OR
N(PRODUCT.MODEL)='C' ' OR N(PRODUCT.MODEL)=D' THEN '1' ELSE '2'

Yes, I know what you're thinking, but that's what you have to do if you
want it to work.

Regards

Malcolm Bull


Reply With Quote
  #2  
Old   
Mike Preece
 
Posts: n/a

Default Re: A synonym to group data (D3/NT) - 09-17-2006 , 06:33 AM







MBTraining (AT) aol (DOT) com wrote:
Quote:
The correct syntax is much like that in Basic programming, and the
logical test(s) you have in the correlative is incomplete

A;IF N(PRODUCT.MODEL)='A' 'B' 'C' 'D' THEN '1' ELSE '2'

What you have to write is something like

A;IF N(PRODUCT.MODEL)='A' OR N(PRODUCT.MODEL)='B' OR
N(PRODUCT.MODEL)='C' ' OR N(PRODUCT.MODEL)=D' THEN '1' ELSE '2'

Yes, I know what you're thinking, but that's what you have to do if you
want it to work.

Regards

Malcolm Bull
That's fine - and will work (if the typo with one of the quote marks
being in the wrong place is fixed) - but it is a bit long-winded and
not so easy to change if the requirements change. A better idea might
be to use a control file keyed on "product model" with a single
attribute of manager:-

CREATE-FILE PRODUCT.MODELS 1 1
Then, just to make things neat and tidy, create a dictionary item
MANAGER:-
ED DICT PRODUCT.MODELS MANAGER
001 A
002 1
003 Manager]Code
004
005
006
007
008
009 L
010 7

You might also like to create a MANAGERS file so that, if the people
responsible for the PRODUCT.MODELS get promoted or something and
someones else takes over their role, you can just change their name:
CREATE-FILE PRODUCT.MODEL.MANAGERS 1 1
ED DICT PRODUCT.MODEL.MANAGERS NAME
001 A
002 1
003 Name
004
005
006
007
008
009 T
010 30

Then populate the files. Create an item in PRODUCT.MODEL.MANAGERS for
each manager with their name in attribute 1, keyed on "1" and "2" for
example. Create an item in PRODUCT.MODELS for each model with the
number, or item-id, of each PRODUCT.MODEL.MANAGER in attribute 1, keyed
on PRODUCT.MODEL. Finally, with these files in place, your "synonym"
would simply do a Tfile translate to find the manager for each model:-
A;N(PRODUCT.MODEL)(TPRODUCT.MODELS;X;;1)

If you want to show the managers' names on a report, the synonym would
be:-
A;N(PRODUCT.MODEL)(TPRODUCT.MODELS;X;;1)(TPRODUCT. MODEL.MANAGERS;X;;1)

If responsibility for a PRODUCT.MODEL changes from one manager to
another, you simply change the manager code in the relevant
PRODUCT.MODELS item. If a manager is replaced, you simply change the
manager's name in PRODUCT.MODELS.MANAGER. No need to change the
"synonym".

Hth,
Mike.



Reply With Quote
  #3  
Old   
johnmarshall@xtra.co.nz
 
Posts: n/a

Default Re: A synonym to group data (D3/NT) - 09-17-2006 , 06:46 AM



Mike

good thinking. One thing that did concern me about the synonym I was
attempting was the fact that if a new product model arrived on the
scene then it would need tweaking.... As luck would have it, there
already is a file on the system to define all the product models and it
currently only has one attribute which defines the product model
description. I'll see about using the second attribute for the manager
code.

regards

John Marshall


Mike Preece wrote:
Quote:
MBTraining (AT) aol (DOT) com wrote:
The correct syntax is much like that in Basic programming, and the
logical test(s) you have in the correlative is incomplete

A;IF N(PRODUCT.MODEL)='A' 'B' 'C' 'D' THEN '1' ELSE '2'

What you have to write is something like

A;IF N(PRODUCT.MODEL)='A' OR N(PRODUCT.MODEL)='B' OR
N(PRODUCT.MODEL)='C' ' OR N(PRODUCT.MODEL)=D' THEN '1' ELSE '2'

Yes, I know what you're thinking, but that's what you have to do if you
want it to work.

Regards

Malcolm Bull

That's fine - and will work (if the typo with one of the quote marks
being in the wrong place is fixed) - but it is a bit long-winded and
not so easy to change if the requirements change. A better idea might
be to use a control file keyed on "product model" with a single
attribute of manager:-

CREATE-FILE PRODUCT.MODELS 1 1
Then, just to make things neat and tidy, create a dictionary item
MANAGER:-
ED DICT PRODUCT.MODELS MANAGER
001 A
002 1
003 Manager]Code
004
005
006
007
008
009 L
010 7

You might also like to create a MANAGERS file so that, if the people
responsible for the PRODUCT.MODELS get promoted or something and
someones else takes over their role, you can just change their name:
CREATE-FILE PRODUCT.MODEL.MANAGERS 1 1
ED DICT PRODUCT.MODEL.MANAGERS NAME
001 A
002 1
003 Name
004
005
006
007
008
009 T
010 30

Then populate the files. Create an item in PRODUCT.MODEL.MANAGERS for
each manager with their name in attribute 1, keyed on "1" and "2" for
example. Create an item in PRODUCT.MODELS for each model with the
number, or item-id, of each PRODUCT.MODEL.MANAGER in attribute 1, keyed
on PRODUCT.MODEL. Finally, with these files in place, your "synonym"
would simply do a Tfile translate to find the manager for each model:-
A;N(PRODUCT.MODEL)(TPRODUCT.MODELS;X;;1)

If you want to show the managers' names on a report, the synonym would
be:-
A;N(PRODUCT.MODEL)(TPRODUCT.MODELS;X;;1)(TPRODUCT. MODEL.MANAGERS;X;;1)

If responsibility for a PRODUCT.MODEL changes from one manager to
another, you simply change the manager code in the relevant
PRODUCT.MODELS item. If a manager is replaced, you simply change the
manager's name in PRODUCT.MODELS.MANAGER. No need to change the
"synonym".

Hth,
Mike.


Reply With Quote
  #4  
Old   
Frank Winans
 
Posts: n/a

Default Re: A synonym to group data (D3/NT) - 09-18-2006 , 12:56 PM



<johnmarshall (AT) xtra (DOT) co.nz> wrote
Quote:
MNGR
001 S
002 0
003 MNGR
004
005
006
007
008 A;IF N(PRODUCT.MODEL)='A' 'B' 'C' 'D' THEN '1' ELSE '2'
009 L
010 4
A;IF N(PRODUCT.MODEL)<"E" THEN '1' ELSE '2'




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.