Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
naziralala
Creator
Creator

Script Change Options

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

3 Replies
HirisH_V7
Master
Master

Hi ,

Script Looks fine and  can you post a sample application if possible .

HirisH
“Aspire to Inspire before we Expire!”
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

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

Check out my new book QlikView Your Business: An expert guide to Business Discovery with QlikView an...

naziralala
Creator
Creator
Author

Can you elaborate some more and explain?