i have 2 tables.
1 is tblForecast and another is tblSales.
tblForecast details is as follows:
date | itemCode | fctSegment | fctQty | fctRevenue |
2025/01/01 | 20008 | Restaurant | 5100 | 15339604 |
2025/01/01 | 20008 | Retail | 330 | 1175764 |
2025/01/01 | 20008 | Web | 4 | 14000 |
2025/01/01 | 20008 | Wholesale | 8086 | 25126718 |
2025/02/01 | 20008 | Restaurant | 5100 | 15339604 |
2025/02/01 | 20008 | Retail | 330 | 1175764 |
2025/02/01 | 20008 | Web | 4 | 14000 |
2025/02/01 | 20008 | Wholesale | 8086 | 25126718 |
for each item everymonth forecast qty and forecast revenue is set for four segments (Retail,web,wholesale and restuarant)
here are the few records
Now i have another table as sales data. this is transactional table:
Date | itemCode | qtySold | revenue | salesTeam | customerSegment | costCenter | ActualSegment |
2025/01/01 | 20008 | 1 | 3150 | Kinki | 2.Wholesale | M1 | Wholesale |
2025/01/04 | 20008 | 1 | 3675 | 4.Retail | Shop_SOK | Retail | |
2025/01/04 | 20008 | 1 | 3675 | SHOP KRM | 4.Retail | Shop_KRM | Retail |
2025/01/04 | 20008 | 5 | 14750 | SHOP KRM | 1.Restaurant | Shop_KRM | Retail |
2025/01/04 | 20008 | 3 | 11025 | 4.Retail | Shop_SML | Retail | |
2025/01/04 | 20008 | 2 | 7350 | 4.Retail | Shop_NSK | Retail | |
2025/01/05 | 20008 | 1 | 3675 | 4.Retail | Shop_SML | Retail | |
2025/01/05 | 20008 | 1 | 3675 | 4.Retail | Shop_NSK | Retail | |
2025/01/05 | 20008 | 2 | 5900 | SHOP KRM | 1.Restaurant | Shop_KRM | Retail |
2025/01/05 | 20008 | 2 | 7350 | SHOP KRM | 4.Retail | Shop_SML | Retail |
2025/01/05 | 20008 | 4 | 12600 | SHOP SOK | 2.Wholesale | Shop_SOK | Retail |
2025/01/05 | 20008 | 2 | 7350 | 4.Retail | Shop_SOK | Retail | |
2025/01/06 | 20008 | 1 | 3675 | 4.Retail | Shop_SML | Retail | |
2025/01/06 | 20008 | 1 | 3675 | 4.Retail | Shop_NSK | Retail | |
2025/01/06 | 20008 | 1 | 2950 | Hokkaido | 1.Restaurant | M1 | Restaurant |
2025/01/06 | 20008 | 1 | 2950 | Kanto | 1.Restaurant | M1 | Restaurant |
2025/01/06 | 20008 | 20 | 66000 | KBS | 2.Wholesale | M2 | Wholesale |
2025/01/06 | 20008 | 8 | 23600 | SHOP SOK | 1.Restaurant | Shop_SOK | Retail |
2025/01/06 | 20008 | 22 | 77000 | 4.Retail | Ambika_Web | Web | |
2025/01/06 | 20008 | 2 | 7350 | 4.Retail | Shop_SOK | Retail | |
2025/01/06 | 20008 | 2 | 5900 | 5.Staff (Restaurant) | M1 | Retail | |
2025/01/06 | 20008 | 28 | 88200 | Wholesale 1 | 2.Wholesale | M1 | Wholesale |
2025/01/06 | 20008 | 32 | 100800 | Wholesale 2 | 2.Wholesale | M1 | Wholesale |
2025/01/06 | 20008 | 5 | 14750 | Group | 1.Restaurant | M1 | Restaurant |
2025/01/06 | 20008 | 7 | 20650 | Kanagawa | 1.Restaurant | M1 | Restaurant |
2025/01/06 | 20008 | 8 | 23600 | Kobe | 1.Restaurant | M1 | Restaurant |
2025/01/06 | 20008 | 7 | 20650 | Chubu | 1.Restaurant | M1 | Restaurant |
2025/01/06 | 20008 | 48 | 143148 | Japanese | 1.Restaurant | M1 | Restaurant |
2025/01/06 | 20008 | 28 | 77600 | Tokyo | 1.Restaurant | M1 | Restaurant |
2025/01/07 | 20008 | 1 | 3675 | 4.Retail | Shop_KRM | Retail | |
2025/01/07 | 20008 | 1 | 2950 | SHOP KRM | 1.Restaurant | Shop_KRM | Retail |
2025/01/07 | 20008 | 4 | 13200 | KBS | 2.Wholesale | M2 | Wholesale |
2025/01/07 | 20008 | 4 | 11800 | SHOP SOK | 1.Restaurant | Shop_SOK | Retail |
2025/01/07 | 20008 | 46 | 144900 | SHOP SOK | 2.Wholesale | Shop_SOK | Retail |
2025/01/07 | 20008 | 22 | 77000 | 4.Retail | Ambika_Web | Web | |
2025/01/07 | 20008 | 5 | 14750 | Tokyo | 3.Other | M1 | Retail |
2025/01/07 | 20008 | 48 | 143200 | Group | 2.Wholesale | M1 | Wholesale |
2025/01/07 | 20008 | 14 | 44100 | Chubu | 2.Wholesale | M1 | Wholesale |
now i want to create a blend where i can get a chart table (piovt) in the following way
when i select the date control from 1st Jan to 07st jan
itemCode, fctQty, qtySold, sold%,fctRevenue, Revenue
20008, 13520, 391, 2.89%, 41656086, 1222248..
when i change the date to Feb, it changes accordingly..
I hope you unestrand the problem i getting because fctTble has single date (for each mont) but salesTable is a transactional table so it has same date and many other date in the same month multiple times. Pleas help! i have tried using chatgpt..but fail!.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |