407-248-1481

QuoteWerks Knowledgebase Topic (Article ID 5458)

Print Layouts - IF Statements

This information applies to :

Article ID
5458

Created/Updated
March 3, 2009

Category
Print Layouts


Are you using the most current release of QuoteWerks?
Version 24.0 Build 4
Examples of Nested IF statements:

.IF. a=1 .THEN. "Hello" .ELSE. (.IF. a=2 .THEN. "Goodbye" .ELSE. "Third Result")

------------------------------------------------------------
The following If then else statement serves as an example, but does not work because it contains too many operators and fields for the report engine expression evaluator:

.if.calc->MonthNumber=1.then."January".else.(.if. Calc->MonthNumber=2.then."February".else. (.if. Calc->MonthNumber=3 .then. "March" .else.(.if. Calc->MonthNumber=4 .then. "April" .else.(.if. Calc->MonthNumber=5 .then. "May" .else.(.if.Calc->MonthNumber=6 .then. "June" .else.(.if. Calc->MonthNumber=7 .then. "July" .else.(.if. Calc->MonthNumber=8 .then. "August" .else.(.if.
Calc->MonthNumber=9 .then. "September" .else.(.if.Calc->MonthNumber=10 .then. "October" .else.(.if. Calc->MonthNumber=11.then. "November" .else.(.if. Calc->MonthNumber=12 .then. "December")))))))))))


-----------------------------------------------------------
Build 17 and above supports the following formula:

.if.month(documentheaders->docdate)=1.then."January".else.(.if.month(documentheaders->docdate)=2.then."February".else.(.if.month(documentheaders->docdate)=3.then."March".else.(.if.month(documentheaders->docdate)=4.then."April".else.(.if.month(documentheaders->docdate)=5.then."May".else.(.if.month(documentheaders->docdate)=6.then."June".else.(.if.month(documentheaders->docdate)=7.then."July".else.(.if.month(documentheaders->docdate)=8.then."August".else.(.if.month(documentheaders->docdate)=9.then."September".else.(.if.month(documentheaders->docdate)=10.then."October".else.(.if.month(documentheaders->docdate)=11.then."November".else.(.if.month(documentheaders->docdate)=12.then."December")))))))))))

___________________________________________________

Formula to replace the quantity numbers with the word for each number:

.if.documentitems->qtytotal=1.then."(one)".else.(.if.documentitems->qtytotal=2.then."(two)".else.(.if.documentitems->qtytotal=3.then."(three)".else.(.if.documentitems->qtytotal=4.then."(four)".else.(.if.documentitems->qtytotal=5.then."(five)".else.(.if.documentitems->qtytotal=6.then."(six)".else.(.if.documentitems->qtytotal=7.then."(seven)".else.(.if.documentitems->qtytotal=8.then."(eight)".else.(.if.documentitems->qtytotal=9.then."(nine)".else.(.if.documentitems->qtytotal=10.then."(ten)".else.(.if.documentitems->qtytotal=11.then."(eleven)".else.(.if.documentitems->qtytotal=12.then."(twelve)")))))))))))

New Search