Welcome to Marg Care - Marg ERP 9+

Home > Margerp > Gui Format > How to use 'IIF' Command in Marg Software?

How to use 'IIF' Command in Marg Software?

2747

Ans.1

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:

  • Go to Masters > Marg Setups > Self Format.

  • A 'Self Format' window will appear. Enter the password.

  • An 'Invoice Format' window will appear.
  • The user will select the format as per the requirement.
  • Suppose select AC.

  • Now the user will select ‘Bill Format’

  • Then a 'Bill format-GUI-AC' window will appear.
  • The user will select Item.

 

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.

  • Thereafter all the commands related to product will appear.
  • Now the user will select the MRP command and then press 'F1' key to search the command of IIF.

  • A 'Format Variables' Window will appear.
  • Thereafter the user needs to type 'IIF'.
  • Now all the results related to IIF will appear.
  • The user will select 'IIF command'. Press 'Enter' key.

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.

  • The user will press 'F3' key to apply the searched command.
    • Then the user can view the command will get applied successfully.

    • Then the user needs to enter the MRP command(on which the condition will be applied) instead of SL_SC.

    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

    • Now the user will enter the Sign with condition.
    • In our case:  If the MRP of the item is less than 100 then print 100
    • Then mentioned 'IIF(SB_MRP < 100,{ '100' } '

    The user can also use:

    • =IIF(SB_MRP < 100, { '100' }

    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.

    • Then in order to print MRP, the user will enter the MRP command.

    Note: The user can also search the command by pressing 'F1' function key and then press 'F3' to apply the command.

    • Thereafter, the user can view the full command is < IIF(SB_MRP < 100, { "100"} , {< SB_MRP> }) >
    • In the above example, the IIF function in SB_MRP is saying IF (MRP Is Less Than 100, then print “100”,otherwise print “MRP”) 
    • Now press 'Ctrl+W' key on it.

    • Then click on 'Save' to save the details.

    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.


    Submit Feedback