Forum Discussion
Fahad5
4 years agoFrequent Visitor
Expressions that yield variant data-type cannot be used to define calculated columns.
Hi all, Please help below function is getting error, Please help me. Partition-1 = IF(ISBLANK(TOKENFLEX_COUNT[Partition_1]),FORMAT(TODAY()-1,"yyyymmdd"),TOKENFLEX_COUNT[Partition_1])
- 4 years ago
You'll get this error if the result-if-true and the result-if-false arguments of IF return different data types, for example, text when true and a number when false.
If you want to return text in the case of a blank, then you need to also return text when it's not blank too. You could use FORMAT there as well. For example,
Partition-1 = VAR Partition = TOKENFLEX_COUNT[Partition_1] RETURN IF ( ISBLANK ( Partition ), FORMAT ( TODAY () - 1, "yyyymmdd" ), FORMAT ( Partition, "Standard" ) )
AlexisOlson
Super User
4 years agoYou'll get this error if the result-if-true and the result-if-false arguments of IF return different data types, for example, text when true and a number when false.
If you want to return text in the case of a blank, then you need to also return text when it's not blank too. You could use FORMAT there as well. For example,
Partition-1 =
VAR Partition = TOKENFLEX_COUNT[Partition_1]
RETURN
IF (
ISBLANK ( Partition ),
FORMAT ( TODAY () - 1, "yyyymmdd" ),
FORMAT ( Partition, "Standard" )
)