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: 
smilingjohn
Specialist
Specialist

Calendar join

Hi ALl,

 

I have a table called transcational table  and has "Declared_Date " , "Arrive Date" and "Actaul date" and i see that there is script  written below to this table . 


Calendar:
LOAD

Date(MinDate + IterNo() -1,'DD/MM/YYYY') as Date,
Date(MinDate + IterNo() -1,'YYYY') as Year,
Date(MinDate + IterNo() -1,'MM/YY') as Month,

While
MinDate + IterNo() -1 <=MaxDate;

LOAD
min(Declared_Date ) as MinDate,
max(Declared_Date ) as MaxDate

Resident Transactional;

But in the table viewer this table is not connected to the Transactional table .
How do i insert "Declared_Date" within this calender so that there will be mapping between Calendar and Transaction table .

Thanks in Advance.

Labels (1)
2 Solutions

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Replace the first line with:

Date(MinDate + IterNo() -1,'DD/MM/YYYY') as Declared_Date,

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

Kushal_Chawda
MVP
MVP

Change the script as highlighted by @jonathandienst  

Calendar:
LOAD

Date(MinDate + IterNo() -1,'DD/MM/YYYY') as Declared_Date,
Date(MinDate + IterNo() -1,'YYYY') as Year,
Date(MinDate + IterNo() -1,'MM/YY') as Month,
Date(MinDate + IterNo() -1,'YY') & '_' & Num(Week(MinDate + IterNo() -1),'00') as Week

While
MinDate + IterNo() -1 <=MaxDate;

LOAD
min(Declared_Date ) as MinDate,
max(Declared_Date ) as MaxDate

Resident Transactional;

View solution in original post

4 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Replace the first line with:

Date(MinDate + IterNo() -1,'DD/MM/YYYY') as Declared_Date,

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

If you want to link the calendar to all three dates, these posts will help:

https://community.qlik.com/t5/Qlik-Design-Blog/Canonical-Date/ba-p/1463578

https://community.qlik.com/t5/QlikView-Documents/Linking-to-two-or-more-dates/ta-p/1495322

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
smilingjohn
Specialist
Specialist
Author

Thanks @jonathandienst  

I dud as per your suggestion but the output result is not working . 

Can you please explain me what exactly this script is doing ? 

Calendar:
LOAD

Date(MinDate + IterNo() -1,'DD/MM/YYYY') as Date,
Date(MinDate + IterNo() -1,'YYYY') as Year,
Date(MinDate + IterNo() -1,'MM/YY') as Month,
Date(MinDate + IterNo() -1,'YY') & '_' & Num(Week(MinDate + IterNo() -1),'00') as Week

While
MinDate + IterNo() -1 <=MaxDate;

LOAD
min(Declared_Date ) as MinDate,
max(Declared_Date ) as MaxDate

Resident Transactional;

Or is there any other way to handle this ?

 

Thanks 

Kushal_Chawda
MVP
MVP

Change the script as highlighted by @jonathandienst  

Calendar:
LOAD

Date(MinDate + IterNo() -1,'DD/MM/YYYY') as Declared_Date,
Date(MinDate + IterNo() -1,'YYYY') as Year,
Date(MinDate + IterNo() -1,'MM/YY') as Month,
Date(MinDate + IterNo() -1,'YY') & '_' & Num(Week(MinDate + IterNo() -1),'00') as Week

While
MinDate + IterNo() -1 <=MaxDate;

LOAD
min(Declared_Date ) as MinDate,
max(Declared_Date ) as MaxDate

Resident Transactional;