2016년 12월 16일 금요일

How to SELECT the most used item in a Fusion Tables Column ?


Thanks to Taifun and Hossein, I choosed to use the fusion tables to make my form with AI2.
It's now working perfectly !
But I still have an issue, I want to offer the possibility to the users some statistics.
Let's say that each user have to say wich city he prefer, he have the choice betwen 100 cities.
Once he choose, I want to tell him what is the most popular city.

How can I write my query to get the most used answer ?

Also, let's say that after choosing my city, I can choose bettwen 3 other criteria.

How do I write my query to the city that have the most 1st or 2nd or 3rd criteria ?

Thank you very much, very appreciate.
Looking for answer since 2 days :(

-- 
use group by, see this similar solution http://stackoverflow.com/a/2722426/1545993

-- 
You will need to keep a separate survey response table, in addition to your table of cities.
The Fusion Table Merge facility can be set up to match by city name, though it is tricky.

-- 
Thanks again for your useful information.
Will dig into this and post screenshot once it's working for future request.

-- 
As you can see, it's working ! 
In the screenshot, you can see the result : 

- The selection the largest number of answer is "Ligne RER B" with 4 votes.

New issue, I can't use the query result as it is. Question is : How only keep "Ligne RER B" ?

Sans titre.png 표시 중

-- 
Your query result text can be used as a csv table, with the appropriate csv conversion block.
Your answer is in column 2 of row 2.
Use the SELECT block, twice.

-- 
Thx for your answer. After reviewing all the sql formating query result, it was my Guess.
Unfortunetly I'm not confortable at all with list, csv ...
Can you help me à little bit more on how to do it ?

--
-- 
When i use " from csv table to list",
It return only the 2nd Line, but then how isolate only "Ligne RER B".

Any suggestion ?

--
split at comma if you got a text line with a comma, then select the 2nd element.
Show us your blocks  and the Do It values.

-- 
I drop the CSV idea and use the Split fonction.
I split the first time with \n to choose the second line and a second time with comma to choose the second item.
I can probably do it better, but it 's actually doing the job.
If you have any idea to improve the code, you're welcome ! :)
Sans titre.png 표시 중


-- 
set global result to list from csv table get result
set Label1.Text to select list item list= (select list item list=get global result, index=2) index=2)




-- 

댓글 없음:

댓글 쓰기