Forum Discussion

bhelou's avatar
bhelou
Icon for Responsive Resident rankResponsive Resident
5 years ago
Solved

If Condition ( text and value )

Dear ,   Kindly please correct me this measure in a column : ( it is returning the value of the text combined   ReceivedIssued or RecievedReceived for the inventory ) Material_Status = IF ( ...
  • Greg_Deckler's avatar
    Greg_Deckler
    5 years ago

    bhelou Something along the lines of:

    Material_Status =
    SWITCH(TRUE(),
      XX_AWPT_MTL_MATERIAL_TRX[SOURCE_TYPE]= "Account alias" && XX_AWPT_MTL_MATERIAL_TRX[Net_Value]<0,"Issued",
      XX_AWPT_MTL_MATERIAL_TRX[SOURCE_TYPE]= "Account alias" && XX_AWPT_MTL_MATERIAL_TRX[Net_Value]>=0,"Received",
      XX_AWPT_MTL_MATERIAL_TRX[SOURCE_TYPE]="Inventory" && XX_AWPT_MTL_MATERIAL_TRX[Net_Value] <0,"Issued",
      XX_AWPT_MTL_MATERIAL_TRX[SOURCE_TYPE]="Inventory" && XX_AWPT_MTL_MATERIAL_TRX[Net_Value] >=0,"Received",
    "Unknown"
    )

    You can just keep tacking on logical conditions to your heart's content.