Skip to content

validate() can't validate numbers in case() #847

@ronja-ui

Description

@ronja-ui

Describe the bug

If there's numbers that are generated with case() function, for some reason validate()` can't validate them but instead shows "Eval comparisons only allow using two numbers or two strings.".

Expected behavior

Numerical values shouldn't be an issue for validate().

How to reproduce

| makeresults count=4
| eval row=1
| accum row
| eval pets=case(row==1, "Jontti", row==2, "Bella", row==3, "Moto", row==4, 6)
| eval validate=validate(isstr(pets), "ERROR", pets=="Jontti", "No fluffy cats")

It should generate the following table:

_time row pets validate
2026-03-24T11:41:19.000+02:00 1 Jontti
2026-03-24T11:41:19.000+02:00 2 Bella No fluffy cats
2026-03-24T11:41:19.000+02:00 3 Moto No fluffy cats
2026-03-24T11:41:19.000+02:00 4 6 No fluffy cats

Values generated with case() are automatically string values so that's why 6 doesn't get the "ERROR" label.

Screenshots

Software version

pth_10 version: 12.1.1

Desktop (please complete the following information if relevant):

  • OS:
  • Browser:
  • Version:

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions