Describes how to use the same table for different settings in the same product.
We want to use tables to return the letters per minute which can be cut, weeded, and transfer tape applied. When we provide the option for 4 different letter sizes in the same product. However, each table in Cyrious is created for specific variables, but we don't want to manage 4 separate tables that contain the same information.
The solution is to create a table (using one of the values, such as LetterHeight as the column variable) and the letters per minute are the row variables. We then override the LetterHeight variable and lookup the price for each size entered in the pricing form.
Declare Size1WeedRate:= LOOKUPTABLEVALUE( "WeedRate", LetterSize1Height ) ; Declare Size1WeedTime := If Size1WeedRate > 0 THen Size1WeedRate * ( LetterSize1_NoOfLtrs ) Else 0 Endif; Declare Size2WeedRate := LOOKUPTABLEVALUE( "WeedRate",LetterSize2Height ) ; Declare Size2WeedTime := If Size2WeedRate > 0 THEN Size2WeedRate * (LetterSize2_NoOfLetters) Else 0 Endif ; Declare Size3WeedRate := LOOKUPTABLEVALUE( "WeedRate",LetterSize3Height ) ; Declare Size3WeedTime := IF Size3WeedRate > 0 THEN Size3WeedRate * ( LetterSize3_NoOfLtrs) ELSE 0 ENDIF; Declare Size4WeedRate := LOOKUPTABLEVALUE( "WeedRate",LetterSize4Height) ; Declare Size4WeedTime := IF Size4WeedRate > 0 THEN Size4WeedRate * (LetterSize4_NoOfLtrs ) ELSE 0 ENDIF; //Calculate total weed time in product for all sizes Declare TotalWeedTime := Size1WeedTime + Size2WeedTime + Size3WeedTime + Size4WeedTime ; //CAlculate price by multiplying total weed time by user constant vinyl hour rate IF TotalWeedTime > 0 THEN ((TotalWeedTime )/60) * VinylHrRate ELSE 0 ENDIF;
Contributor: Steve Gillispie
Date: 7/25/2009
Version: Control 4.3