I have an ExecuteSQL question that I'm hoping you could help solve for me [FMP18A on MAC].
The best way for me to outline my question is to show the process I took to get to where I am currently.
[Example data only]
I have the following TABLE [Sales_Database] and COLUMN [FRUIT] setup, and my SQL calculation gives the following result:
------------------
ExecuteSQL (
"SELECT Fruit, COUNT(*)
FROM Sales_Database
GROUP by Fruit
ORDER by 2 DESC
"
; "" ; "")
Apple, 77
Oranges, 67
Grapes, 57
Pears, 47
Bananas, 37
------------------
I then broke it down further, wanting the results to only display the top most value (Apple). So, my SQL calculation and result was thus:
------------------
"SELECT Fruit, COUNT(*)
FROM Sales_Database
GROUP by Fruit
ORDER by 2 DESC
FETCH FIRST 1 ROWS ONLY
"
; "" ; "")
Apple, 77
------------------
So far, so good.
HOWEVER, for the purpose of using the result in a HIDE OBJECT WHEN calculation, I need the result to only show the word "Apple" no number attached.
Removing the COUNT(*) just results in the calculation ordering the values by the length of their letters.
I hope there's a solution to this problem, and thank you all in advance.