Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
Can anyone suggest changes.
I need to alter this script as below:
[Temp Data Aggr]:
Load
Country,
[CityCode] as [City Code],
[Check week] as [Check-in week],
Country&'-'&[CityCode]&'-'&[Check week] as Key,
Count([Booking ID]) as [$(vCurrYear)]
Resident [Tmp Data ]
Where [Booking Year]=$(vCurrYear)
Group By
Country,
[CityCode],
[Check week]
Order By
Country asc,
[CityCode] asc,
[Check week] asc;
//===========================================================================
//calculate the aggregated Year on Year data
//===========================================================================
Let vCurrYear=($(vCurrYear)-1);
Do while vCurrYear>=vYearToLoad
Left Join
Load
Country,
[CityCode] as [City Code],
[Check week] as [Check-in week],
Country&'-'&[CityCode]&'-'&[Check week] as Key,
Count([Booking ID]) as [$(vCurrYear)]
Resident [Tmp Data ]
Where [Booking Year]=($(vCurrYear))
Group By
Country,
[CityCode],
[Check week]
Order By
Country asc,
[CityCode] asc,
[Check week] asc;
Let vCurrYear=($(vCurrYear)-1);
loop;
This script is giving me errors in my final count of number of records...
Thanks.
Nazira
Hi ,
Script Looks fine and can you post a sample application if possible .
Wouldn't it be better to calculate Year as a field and calculate a single GROUP BY load with Year as one of the GROUP BY fields? This way, you can operate with each year's count more freely than having a number of columns, one for each Year?
Otherwise - yes, a sample app would be better to troubleshoot, than trying to find errors in the script...
cheers,
Oleg Troyansky
Can you elaborate some more and explain?