Forum Discussion

admin11's avatar
admin11
Memorable Member
5 years ago
Solved

Expression allow me add more then 2 Reporting Code

Hi All

 

I have this expression work fine :-

 

_ASSET =
SWITCH(TRUE(),
'GL'[Reporting Code]>=50010 &&'GL'[Reporting Code]<=50010,"_ASSET",
BLANK())
 
May i know how to modify the above expression , so that i can add more then 2 Reporting Code into above expression below :-
50023
60025
 
Paul
 
 

6 Replies

  • admin11 

    Paul,

    You can simplify it to

    _ASSET =
    SWITCH(
    TRUE(),
    'GL'[Reporting Code] IN {50010, 50023, 60025}, "_ASSET",
    BLANK()
    )

    Regards

    Phil

    • admin11's avatar
      admin11
      Memorable Member

      PhilipTreacy 

      Thank you phil , it work fine , now the expression shorter.

      Can share using IF command, how the expression look like ?

       

      Paul

      • aj1973's avatar
        aj1973
        Community Champion

        admin11 

        Here you go Paul

         

        _ASSET = IF(GL[Reporting Code] IN {50010, 50023, 60025}, "_ASSET", BLANK())
        
        
        //SWITCH(
        //TRUE(),
        //'GL'[Reporting Code] IN {50010, 50023, 60025}, "_ASSET",
        //BLANK()
        //)

         

  • Anonymous's avatar
    Anonymous
    Not applicable

    Try this- 

    _ASSET =
    SWITCH(TRUE(),
    'GL'[Reporting Code]>=50010 &&'GL'[Reporting Code]<=50010,"_ASSET",
    'GL'[Reporting Code]>=50023 &&'GL'[Reporting Code]<=50023,"_ASSET",
    'GL'[Reporting Code]>=60025 &&'GL'[Reporting Code]<=60025,"_ASSET",
    BLANK())