Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Replace BLANK to another text

I have start and end data columns

Some End data is blank. so Chart shows that data (Blank)

I would like to change that (Blank) to another text.

I tried

New Measure = if(ISBLANK([Original Measure]),"Presence",[Original Measure])

 

But I got error that "Expressions that yield variant data-type cannot be used to define calculated columns."

 

Is there any way to change (Blank) text?

 

Thank you advance!

  • parry2k's avatar
    parry2k
    7 years ago

    Anonymous seems like your [original measure]  is not of text type, you can do something like this

     

     New Measure = if(ISBLANK([Original Measure]),"Presence",
    FORMAT([Original Measure], "######0.00" ) )

    basically you are converting your original measure to text, you can change the format string based on your need.

     

     

5 Replies

  • Anonymous  What data type are your "start" and "end" data fields? 

    • parry2k's avatar
      parry2k
      Super User

      Anonymous seems like your [original measure]  is not of text type, you can do something like this

       

       New Measure = if(ISBLANK([Original Measure]),"Presence",
      FORMAT([Original Measure], "######0.00" ) )

      basically you are converting your original measure to text, you can change the format string based on your need.

       

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi, Your Answer is great! I try it and work!

        My data is datetime format, so use your code like this:

        EndTimeFix = IF(ISBLANK([EndTime]),"Presence", FORMAT([EndTime],"General Date"))
         
        Thank you for your help:)
    • Anonymous's avatar
      Anonymous
      Not applicable

      Start End date type is datetime

      • parry2k's avatar
        parry2k
        Super User

        Anonymous did you tried the measure I posted?