Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
richard_chilvers
Specialist
Specialist

Script not executing IntervalMatch

I have a script which uses the Extended Syntax form of IntervalMatch. When I execute it, it seems the IntervalMatch is skipped over altogether without any errors. I would have expected the IntervalMatch table would always be created (although if I have done it wrong, it may have no rows)?

This is the statement:

INTERVALMATCH(XSDP_DATE_POSTING, XSDP_XCET_ID) LOAD DISTINCT XPRD_DATE_OPEN, XPRD_DATE_CLOSE, Vessel_Code RESIDENT Cruises ;

As a separate, related question, with IntervalMatch work only on dates, or any numeric values?

Any advice is appreciated.

8 Replies
swuehl
MVP
MVP

I think the Table you apply the LOAD prefix to is missing the extended IntervalMatch key, isn't it?

Maybe you can describe your tables and requirements a bit closer, this surely helps in resolving your issue.

To your second question, it should work with all numeric intervals.

richard_chilvers
Specialist
Specialist
Author

Hi

I'm not sure I understand. I am hoping to match the key called XSDP_XCET_ID to Vessel_Code. Have I misunderstood the format ?

Regards

Not applicable

From QV Help Doc....
"The syntax is:

intervalmatch (matchfield,keyfield1 [ , keyfield2, ... keyfield5 ] ) (loadstatement | selectstatement ) "

swuehl
MVP
MVP

Well, it's probably me who's not understanding.

I believe you need to state a field as key that you are actually using in your LOAD, like in

INTERVALMATCH(XSDP_DATE_POSTING,  Vessel_Code) LOAD DISTINCT XPRD_DATE_OPEN, XPRD_DATE_CLOSE, Vessel_Code RESIDENT Cruises ;


What's that second field XSDP_XCET_ID for or coming from?

jpapador
Partner - Specialist
Partner - Specialist

The key fields have to be named the same I believe.  Vessel_Code should be aliased to XSDP_XCET_ID

Not applicable

Try using INNER JOIN.

Example:

Load Key, Name, Date, Sales

from Transact.xls;

INNER JOIN

intervalmatch (Date,Key)

Load FirstDate, LastDate, Key

resident Key;

richard_chilvers
Specialist
Specialist
Author

Thanks to jpapador and swuehl who both agree that the key field(s) need to be identical.

I think IntervalMatch is tricky and not well documented so I will give this a try !