Welcome!

This community is for professionals and enthusiasts of the Genio platform.
Share your questions and challenges, and help your partners!

1

0
Carlos Nogueira
Activé 17/02/2020 16:33

Hi,

It's not clear in your model if one instance of your product ('Artigo') represents a generic item that will generate multiple sells or if it's meant to be a representation of an individual item and it's unique (and therefore can only be sold once).

If the first is true, you might need to add a stock management, where sales decrease and supplies increase stock values, so that you know when it's 'sold out' (stock equals zero). 

If the last is true, the formula that counts related records (SR) from related tables applied directly to the 'sold' field will grant what you need ([SALES->1]).

Hope this helps,



0
Rodrigo Serafim
Activé 14/02/2020 16:27

Its probably more informative to know how many times an item has been sold. You can achieve that easily by adding a new related sum field to the 'Artigos' table. Call it 'NumSales' for example. You should use a 'Related Sum' type of formula and count the number of rows of 'Sales':

[SALES->1]

If you want to have boolean notion of each item having been sold or not you can then set the 'Vendido' field as an 'Arithmetic' formula based on the value of the previous field:

iif([ARTIG->NUMSALES]==0, 0, 1)

But this might be a bit redundant now that you have a count of the number of sales.


Keep Informed

About the Community

This platform is for beginners and experts willing to share their Genio knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers. Read Guidelines

Question tools

16 follower(s)

Stats

Asked: 14/02/2020 12:13
Seen: 1616 times
Last updated: 17/02/2020 16:33