Home > Margerp > Gui Format > How to use 'IIF' Command in Marg Software?
The IIF function is one of the most popular functions in Marg Software, and it allows user to make logical comparisons between a value and what user expect.
So an IIF statement can have two (dependable) results i.e. if first condition would be fulfilled then the software will show the first condition as result however if it would not be fulfilled then software must go with the second condition user have entered.
In order to print IIF condition, the user will follow the below steps:
Let's take an example: If the MRP of the item is less than 100 then software will print 100 otherwise actual MRP of the item should print on the invoice format.
Description of the Command:
a. Main command of 'IIF condition' :
The highlighted part (in the above screenshot) shows the Main command of the IIF condition. i.e. In this impression user need to enter the particular command on which all the conditions needs to be made.
Suppose In our case user need to use MRP command as main and the further conditions (<,=,>,) needs to be made on this MRP command
b. Sub Command of 'IIF Condition'.
Here, after main command, user need to mention the sign (that needs to be used to satisfy user IIF condition) and then mention the value (which will be used to make the comparison between First or second condition).
For example in our case user need if the MRP of the product is less than Rs 100 then software will pick the MRP as rs 100, otherwise if the greater than Rs 100 will pick the actual MRP of the product.
Following Signs that can be used in the IIF condition:
# | Condition | Sign(Use) |
---|---|---|
1 | More than | > |
2 | Equal to | = |
3 | Not Equal to | # |
4 | Greater than or equal to | >= |
5 | less than or equal to | <= |
1st Condition or True value of the IIF Function.
This highlighted part shows the first condition or priority of the user, which means if it will be satisfied then software will print the result according to the first condition only, otherwise will check the second condition for the final result.
2nd Condition or False value of the IIF Function
Here, user need to mention the second condition, which will be used in case when user first condition would not be fulfilled.
Important: Now we are implementing the above explained conditions in the software to get the final result of the IIF function.
Note: The user can also search the command by pressing 'F1' function key and then press 'F3' to apply the command.
Fig 1: Change the SL_SC command with MRP command
Fig 2: Display MRP command
The user can also use:
In the above example, the IIF function in SB_MRP is saying IF (MRP Is Less Than 100, then print '100')
Note: If user is going to use text in formulas, then need to wrap the text in quotes (e.g. 'Text'). The only exception to that is using TRUE or FALSE, which software automatically understands.
Note: The user can also search the command by pressing 'F1' function key and then press 'F3' to apply the command.
After following the above steps the item MRP of the item will be printed as required.
Suppose print a bill for an item whose MRP is less than 100.