formula in text box

Stimulsoft Dashboards.JS discussion
Post Reply
palmer83
Posts: 16
Joined: Thu Apr 20, 2023 7:33 pm

formula in text box

Post by palmer83 »

Hello, I want a text box to display different messages based on the max value in a data source.

If this were my data source named Employees, what formula could I write such that "Sales" displayed in the text box given that it had the max value in Employee Count?
DEPARTMENT, EMPLOYEE COUNT
Sales, 205
Human Resources, 100
Customer Service, 97
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: formula in text box

Post by Lech Kulikowski »

Hello,

Please try to use the following expression:
{FirstIf(DataSource.DEPARTMENT, DataSource.COUNT== Totals.Max(DataSource.COUNT))}

Thank you.
palmer83
Posts: 16
Joined: Thu Apr 20, 2023 7:33 pm

Re: formula in text box

Post by palmer83 »

Hello,

That doesn't seem to be working. The textbox prints as blank. I also noticed that even if I just do Totals.Max(DataSource.COUNT) I still get a blank text box.
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: formula in text box

Post by Lech Kulikowski »

Hello,

Please send us a sample report with test data that reproduces the issue for analysis.

Thank you.
palmer83
Posts: 16
Joined: Thu Apr 20, 2023 7:33 pm

Re: formula in text box

Post by palmer83 »

For some reason, it's not letting me attach the dashboard file. But using the attached data file, the dashboard would contain a text box that had exactly this:
{"The department with the most employees is " + FirstIf(Sheet1.DEPARTMENT, Sheet1.EMPLOYEE_COUNT == Totals.Max(Sheet1.EMPLOYEE_COUNT))}
Attachments
fake_data.xlsx
(8.72 KiB) Downloaded 145 times
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: formula in text box

Post by Lech Kulikowski »

Hello,

Unfortunately, in dashboards, it is not possible.

Thank you.
Post Reply