Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
ym
Contributor II
Contributor II

Multiple Date Fiels

I have the following code:

 

Order:

%ID,

Product, 

Quantity,

DateOrder,

DateBooking

FROM ..

 

OrderCalendar:

LOAD

num([DateOrder]) as [%DateOrder],

Year([DateOrder) AS Year.DateOrder,

RESIDENT Order;

 

BookingCalendar:

num([DateBooking]) as [%DateBooking],

Year([DateBooking) AS Year.DateBooking,

RESIDENT Order;

 

Now, I would like to add a table that specifiy the DateTyp (Type = Order or Booking). 

How can I do this?

Labels (3)
5 Replies
PrashantSangle

create static flag for DateType

like

OrderCalendar:

LOAD

num([DateOrder]) as [%DateOrder],

Year([DateOrder) AS Year.DateOrder,

'Order' as DateType

RESIDENT Order;

 

BookingCalendar:

num([DateBooking]) as [%DateBooking],

Year([DateBooking) AS Year.DateBooking,

'Booking' as DateType

RESIDENT Order;

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
sidhiq91
Specialist II
Specialist II

@ym  as @PrashantSangle  mentioned you can create the static flag and if required you can concatenate both the tables:

OrderCalendar:

LOAD

num([DateOrder]) as [%DateOrder],

Year([DateOrder) AS Year.DateOrder,

'Order' as DateType

RESIDENT Order;

 

Concatenate(OrderCalendar)

BookingCalendar:

num([DateBooking]) as [%DateBooking],

Year([DateBooking) AS Year.DateBooking,

'Booking' as DateType

RESIDENT Order;

ym
Contributor II
Contributor II
Author

@sidhiq91 This gives a synthetic key. (DateOrder/DateBooking). How can I solve this?

 

sidhiq91
Specialist II
Specialist II

@ym  I dont see any common fields between the tables. Could you please provide screen shot of the Synthetic table and keys?

ym
Contributor II
Contributor II
Author

The problem is that in my Order Table I have also 

%DateOrder and %DateBooking.