I have the following tables
Products, Prices, stores (Suppliers) and Country
Products table:
ProductID, ProductName
Stores Table:
StoreID, StoreName, Country (country name of the supplier)
Price Table:
PriceID, Date, Price, StoreID, ProductID
Country Table
CountryID, StoreID, CountryName
Sample Price Table Data (ID, Date, Price, StoreID, ProductID)
1, 01-10-2014, 1500, 1, 8
2, 01-10-2014, 1800, 2, 9
3, 10-10-2014, 1700, 2, 8
4, 01-09-2014, 1200, 1, 8
5, 07-09-2014, 1300, 2, 8
In Stores Table
1, Supplier1, UAE
2, Supplier2, GB
In Product Table
8, iPad Air 32GB 4G
9, iPad Air WiFi 16GB
Now i need to create a line based chart. There will be two lines on the chart. To create the two lines i need two columns from this table - the UAE and UK
So my expected result is
ID Date UAEPrice UKSupplier SupplierName
1 01-10-2014 1500 Null Supplier-1
2 01-10-2014 NULL 1800 Supplier-2
3 10-10-2014 NULL 1700 Supplier-2
4 01-09-2014 1200 Null Supplier-1
5 07-09-2014 Null 1300 Supplier-1
I am confused with this... Currently I am trying with two Table View (one with stores.countryID = 'AE'
and one with stores.CountryID <> 'AE'
).
Please help.