Group By + Select + suggested value

rrhirani
Participant IV

I am writing one expression which gives me unique value of column but I want result associated with second column.

2X_2_271c4602d2eed057b74aaa18c984c54c87c45d89.png
2X_1_1b4963dd832b92bed191ccf881bd53b288fe8e09.png

SELECT(Task[Task(s)],[Organization] = “A”)

Above expression gives me the result (In dropdown)
Task1
Task2
Task3
Task4
Task5
Task6

but I want the result as
Task1 - Section 1
Task1 - Section 2
Task2 - Section 1
Task2 - Section 2
Task3 - Section 1
Task4 - Section 1
Task5 - Section 1
Task6 - Section 2

I need a similar solution as in MySQL

SELECT CONCATE(Task(s),’-’,Section) FROM Task WHERE Organization = “A” GROUP BY Task(s),Section

Any suggestions would be great. Thanks

Solved Solved
0 5 315
1 ACCEPTED SOLUTION

LeventK
Participant V

@rrhirani
You cannot create it with a SELECT expression. I may advise structuring a Virtual Column in that table with simple CONCATENATE expression first:

CONCATENATE([Tasks(s)]," - ",[Section])

And then call this column in your Suggested Values:

SELECT(Task[VirtualColumnName],[Organization]="A")

View solution in original post

5 REPLIES 5

Hi @rrhirani!

I think this is the answer:

SELECT(Task[Section],[Organization] = “A”)

When in doubt, please go to AppSheet documentation

https://help.appsheet.com

and search for the expression you are using – in this case SELECT():

Good luck!

@Kirk_Masden: No, it’s not. I need a similar solution as a MySQL query.

SELECT CONCATE(Task(s),’-’,Section) FROM Task WHERE Organization = “A” GROUP BY Task(s),Section

Sorry. I should have paid closer attention to what you were trying to achieve. I’m glad @LeventK gave you a good answer.

LeventK
Participant V

@rrhirani
You cannot create it with a SELECT expression. I may advise structuring a Virtual Column in that table with simple CONCATENATE expression first:

CONCATENATE([Tasks(s)]," - ",[Section])

And then call this column in your Suggested Values:

SELECT(Task[VirtualColumnName],[Organization]="A")

Perfect, It’s working like a charm!! Many thanks for your prompt reply!! Cheers

Top Labels in this Space