Big number for month

Hello friends of glide.
I have big sales numbers where the salesperson sees the sales he made and his total and profit. At the moment I was able to set it as a total but I would like to extrapolate the data for the current month so in January see only the total of January sales when we are in February will see the data for February. I hope I was clear. Thanks as always to those who will be able to help me.

1 Like

I assume you have a sales table and in there you have a timestamp.

You should be able to use the Date & Time > Format Date column to return a month for each sale.

Then, make a template column joining the sales person’s email with the month you generated above. It will look like:

a@example.com - September 2021

Going back to your user profiles sheet, make another format date column, this time use the current date/time as the input.

As it’s currently Jan 2022, you’ll see “January 2022” returned.

Make another template column to join the user’s email to the month. You’ll have something like:

a@example.com - January 2022

Make a relation using the template column in the user profiles sheet to the template column in the sales sheet, set it to multiple matches.

You should be able to rollup the sales amount based on that relation.

4 Likes

@ThinhDinh grazie per il consiglio…ci provo! poi ti faccio sapere se ci sono riuscito.

1 Like

@ThinhDinh grazie ma non ci sono riuscito

What are you struggling with? Can you attach some screenshots so me or any Italian-speaking members like @Roldy can help?

1 Like

@ThinhDinh this is the table I made (business users) where the salesperson enters the date of the call, if he bought, and the value of the sale. Now the column that I was able to create from January 2022 then I deleted it but I should be able to recreate it. so far there are is after that I can not go on

I assume this is the table where you enter all Sales. Then you should be able to use the format date column to convert the date to the format mmmm yyyy (e.g: January 2022 for 13/1/2022).

That’s the first step in the comment I made above. Then you can read more about the template column here to construct the next steps.

1 Like

@ThinhDinh yes the column that changes the date I can make it. What should I do next?

You should use a template column to construct the template like I noted, please try out all those steps and get back if you have any further problems.

@ThinhDinh I managed to make a model column where I wrote (this month you sold 227 euros) taking the value of the sale … but that’s not what I wanted … I would like to have the total of all sales made in January, then done in February, etc … it should be a rollup limited to current month sales only

1 Like

@ThinhDinh already described how to do this

2 Likes

E’ necessario costruire chiavi che contengano l’agente ed il mese come ti ha spiegato @ThinhDinh e ribadito @Darren_Murphy .
Le tabelle coinvolte sono due: una (A) è quella dove verrà calcolato il subtotale, l’altra (B) è quella che contiene i dati da sommare; quindi la chiave costruita deve esistere in entrambe le tabelle.

Sintetizzando, nella tabella (A) avrai:

  • la colonna template che contiene la chiave costruita
  • la relazione multipla che punta alla colonna template della tabella (B)
  • la colonna rollup che conterrĂ  il totale calcolato dalla relazione multipla

Nella tabella (B) avrai:

  • la colonna template che contiene la chiave costruita.

Ovviamente stiamo ipotizzando uno scenario in cui il tuo agente sceglie qual è il mese (e l’anno) interessato al calcolo (ad esempio tramite una choice).

Fammi sapere se è chiaro e se è quello che volevi ottenere.
Ciao

2 Likes

@Roldy @ThinhDinh @Darren_Murphy grazie a tutti.
Allora ho creato le varie colonne nelle 2 tabelle A e B.
Però se metto la data ad esempio a febbraio come nell’immagine non scrive FEBBRAIO 2022.

Tabella A

Tabella B

di sicuro sbaglio qualcosa

hmm… there are known issues with the date plugins for users in some regions. I wonder if that might be the case here. @Roldy maybe you can confirm?

If that is the case, then you could create something similar using some date math. For example, you could use the following formula in a math column:

Year(Date)*12 + Month(Date) - where Date is your “data vendita”

That would give you a number, that would be the same for all records in the same month. So you could use that to build the relation.

5 Likes

sono riuscito a creare la chiave come detto da @ThinhDinh e @Darren_Murphy in quella che tu dici essere la tabella B.

Ora però non riesco a fare l’associazione così da poter calcolare il venduto per ogni mese.

Do you want to calculate the sales for each month, per each salesperson, then display those on the frontend?

2 Likes

@ThinhDinh Yes

I was not present these last two days, I’ll explain to @Ferdinando_Fogacci using Italian, ok @ThinhDinh ?

2 Likes

Ciao @Ferdinando_Fogacci , abbiamo due possibili scenari, per prima cosa intendiamoci bene su quale dei due ti interessa.

Scenario 1
L’agente (oppure tu) dispone di una schermata in cui può selezionare l’anno e il mese per il quale vuole ottenere il totale delle vendite che lui ha eseguito.

Scenario 2
Tu, che sei l’amministratore, vuoi avere una lista dove in ogni riga c’è un raggruppamento per Anno, Mese, Agente ed il totale relativo del mese.

Lo scenario 1 è più semplice da realizzare dello scenario 2.
Probabilmente ti servono entrambi ma ti consiglio di partire con l’1 per poi capire anche il resto.

Ti chiedo: qual è il motivo per il quale stai costruendo le chiavi utilizzando colonne XC quando invece potresti usare colonne template che concettualmente sono anche più semplici?

Cominciamo con questo:
Nella tabella che contiene i dati delle vendite, avrai sicuramente il nome dell’agente e la data in cui è stata effettuata la vendita. Abbiamo la necessità, qui, di costruire una chiave dove dobbiamo comporre: agente+anno+mese.

  1. L’agente lo abbiamo, useremo la sua mail piuttosto che il nome e cognome perché è una chiave univoca.
  2. Dobbiamo calcolare l’anno dalla data: lo fai con una colonna Math dove imposti la formula YEAR(datadellavendita): se la data è quella di oggi ottieni 2022, basta che imposti la precisione a 1 e togli la spunta da “use group separator”.
  3. Dobbiamo calcolare il mese dalla data: lo fai con una colonna Math dove imposti la formula MONTH(datadellavendita): se la data è quella di oggi ottieni 1, basta che imposti la precisione a 1 e togli la spunta da “use group separator”.

A questo punto, in una colonna template, possiamo assemblare la chiave che ci serve:
nel campo template metterai per esempio: eeeaaammm
Nei suoi replacements:

  • eee è la colonna che contiene la mail dell’agente;
  • aaa è la colonna che contiene l’anno;
  • mmm è la colonna che contiene il mese.

A questo punto nella colonna template avrai risultati del tipo: ferdinando@miosito.it20221
Come vedi questa è una chiave che esprime l’agente, l’anno ed il mese, ed è presente in ogni riga delle vendite.

Realizza questa parte e poi andiamo avanti col resto.

Fammi sapere.
Ciao

3 Likes

Humm… I have not encountered any problems with the dates so far.

1 Like