I couldn't get your CSV file to work at all wthout making some changes to 
it, changing the commas to decimal points and the semicolons to commas. 
Even then, I couldn't get a query to work with it. I know the query works, 
because I used it in a Google Sheet 
<https://docs.google.com/spreadsheets/d/1tswaWUAbeBijHq4o505w0h7TmbD-qGhR3jBactcbGq0/edit#gid=1011451446>
 
I made in cell G1.

Until someone who knows how to do this answers you, I thought of two 
solutions that will work. You can either import the entire CSV file into 
your page as a DataTable then create a DataView and create a table from 
that. The other method is to import your CSV file into a Google Sheet and 
run the query against that to extract the data you need.

I illustrated both of those at https://brisray.com/google-charts/csv.htm 

On Monday, April 8, 2024 at 6:42:41 PM UTC-4 Ale wrote:

> I'm having issues in performing a query that allows me to retrieve the 
> percentage of each expense, filtered by category, using Google sheet Query 
> Language (
> https://developers.google.com/chart/interactive/docs/querylanguage).
>
> Does anyone help me?
>
> I need an output like this:
> Filtered by Category=Fun
> Reason  Percentage
> Biliardo 2,17%
> Birra 23,91%
> Cena 28,87%
> Cinema 12,17%
> Metro 6,43%
> Paninaro 7,39%
> Pizza 6,96%
> Spesa 12,82%
>
> The input is the following table (in CSV):
> Import;Date;Reason;Source;Category
> -4,40;01/02/2024;Metro;Credit Card;Fun
> -10,00;01/02/2024;Birra;Credit Card;Fun
> -2,50;02/02/2024;Biliardo;Credit Card;Fun
> -8,00;03/02/2024;Pizza;Credit Card;Fun
> -63,14;03/02/2024;Benzina;Credit Card;Outcome
> -14,74;10/02/2024;Spesa;Credit Card;Fun
> -35,99;10/02/2024;Regali;Credit Card;Additional outcome 
> 5,50;12/02/2024;Ricarica ticket;Ticket restaurant;Income
> -14,00;12/02/2024;Cinema;Credit Card;Fun
> -5,50;17/02/2024;Birra;Credit Card;Fun
> -5,50;17/02/2024;Birra;Credit Card;Fun
> -8,50;17/02/2024;Paninaro;Credit Card;Fun
> -11,64;18/02/2024;A Satispay;Credit Card;Additional outcome 
> 11,64;18/02/2024;Da Credit Card;Satispay;Additional income 
> -127,00;19/02/2024;Tagliando;Credit Card;Additional outcome 
> -12,80;20/02/2024;Regali;Satispay;Additional outcome 
> -87,44;23/02/2024;Benzina;Credit Card;Outcome
> -3,00;24/02/2024;Metro;Credit Card;Fun
> -33,20;24/02/2024;Cena;Credit Card;Fun
> -6,50;24/02/2024;Birra;Credit Card;Fun
> -3,00;26/02/2024;Treno;Credit Card;Outcome
> -996,99;26/02/2024;Assicurazione auto;Credit Card;Outcome
> -3,00;26/02/2024;Treno;Credit Card;Outcome
> 1.941,11;27/02/2024;Stipendio;Credit Card;Income
> -529,65;28/02/2024;Rata macchina;Credit Card;Outcome
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/a165f5c1-b6d1-4846-9997-4a67dfad20e9n%40googlegroups.com.

Reply via email to