Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Interval match

Hi
I can't see whats wrong with my code. I'm doing a interval match between my Fact and another table where I calculated some fields. I also have a normal master calender. When I select Year and month from my master calender I want to be able to see the NoOfTimes. It looks OK when I look in the data model view but it's not working...when a selection is made with date from my master calender and if I select the key I get all the occurence from the table NoOfOccurence.

My code:

NoOfOccurence:

Load

  %Key ,

  Sum(Flag) as NoOfTimes,

  Makedate(Left(YearMonth,4) ,MId(YearMonth,5), '01')as Date,

Resident      Tmp

Group By      %Key,

                 Date;

Temp_Bridge:

Intervalmatch

(Date, %Key)

Load

  FROMDAT,

  TOMDAT,

  %Key

resident Fact

;

/Thank's 🙂

Labels (1)
2 Replies
Anonymous
Not applicable
Author

Hi check if it works

group by should not be done on renamed Fields

it should look like

My code:

NoOfOccurence:

Load

  %Key ,

  Sum(Flag) as NoOfTimes,

  Makedate(Left(YearMonth,4) ,MId(YearMonth,5), '01')as Date,

Resident      Tmp

Group By      %Key,

                 Makedate(Left(YearMonth,4) ,MId(YearMonth,5), '01') ;

Regards

Harsha

Not applicable
Author

Thank's Harsha,

Unfortunately this did not help When I run the script the result is the followingCapture.PNG.png

I changed the group by to the following:

Group by
%Key,

  YearMonth2,

  Makedate(Left(YearMonth2,4) ,MId(YearMonth2,5), '01')