Notion Answers

Help between Notion users


Register & Ask

It's free & easy

Get answers

Answers, votes & comments

Vote and select answers

Receive points, vote and give the solution

Question

2votes

Notion Formula help

This are two Properties for a Gallery view

A Rank: If the multi-select contains a "Music", a rank should be generated that spits out the number 2, 4 or 6. Based on the timestamp, so always changes randomly.

B Rank: If the product has an A Rank, take this result. If the product has no A Rank, please spit out a number between 1 and n (number of items in this filter), without the numbers 2, 4, 6. Based on the timestamp, so always changes randomly.

Number of Items in this Filter can also be adjusted.

A lot of thanks for the person who can help me with this!!!

1 Answer

2votes

JournoFran Points190

Try this to create a gallery view with two properties:

Use the following formula to create the A Rank property:

if(prop("Multi-Select").contains("Music"), if(round(prop("Timestamp")/1000)%3==0, 2, if(round(prop("Timestamp")/1000)%3==1, 4, 6)), "")

(This formula checks if the Multi-Select property contains "Music" and then generates a random rank (2, 4, or 6) based on the timestamp.)

Use the following formula to create the B Rank property:

if(prop("A Rank"), prop("A Rank"),
if(round(prop("Timestamp")/1000)%2==0, (random()%(n-1))+1, (random()%(n-2))+3))

(Now you are checking if the A Rank property is present and if so, use that value; but if A Rank property is not present, generate a random rank between 1 and n, EXCEPT FOR 2, 4, and 6 which you already used in A.

The random rank is generated based on the timestamp.)

Then you tell it how many items are in the filter by updating the value of n in the B Rank formula.

So, if you want the filter to have 10 items, change (random()%(n-1))+1 to (random()%(10-1))+1 and (random()%(n-2))+3 to (random()%(10-3))+3.

good luck!
(I used GPT to help with this)

Please log in or register to answer this question.

...

Welcome to Notion Answers, where you can ask questions and receive answers from other members of the community.

Please share to grow the Notion Community!

Connect