Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Search same value in same table between two dates

I have one table which has my products. 

 

For each product finds if it was listed in a specific month in the past (the minimun of the date range, here lets say [oct, nov,dec,jan] with min = oct and current=jan) and score each product  as following:

 

1- Product present in both months 100 

2- If Newly listed then score is 50 

3- If was present in the reference period and not listed now then -50

 

I have only table  as follows

DateProductidprice
1-Jan110
1-Dec120
1-Nov130
1-Oct140
1-Jan210
1-Dec212
1-Nov213
1-Jan312
1-Dec314
1-Nov315
1-Oct329
1-Dec414
1-Nov415
1-Oct429

 

Desired result shoul be 

Product score
1100
250
3100
4-50

 

I will appreciate your help

  • Anonymous's avatar
    Anonymous
    6 years ago

    amitchandak Thank you very much.

    It works as expected. Really thank you! this saves long hours of work

2 Replies