Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I'd like to concatenate these two tables.
But the problem is that WeekDay field from the first isn't equals to WeekDay from the second.
How to concatenate in this case and apply a "date" format to the crosstable's field? (I can't change WeekDay from the first table to text)
Example:
Table1:
load ID, Sales,
Store,
WeekDay(Date) as WeekDay, // Mon, Tue, etc.
from source_1;
CrossTable('WeekDay', 'Sales', 2)
Table2:
load ID, Store
Monday as Mon,
Tuesday as Tue,
Wednesday as Wed
.. etc.
from source_2;
With best regards,
Evgeniy Sharahov
Try this
Concatenate (Table1)
LOAD ID,
Store,
Dual(Week, (Match(Week, 'Sun', 'Mon', 'Tue', 'Wed', 'Thur', 'Fri', 'Sat') - 1)) as WeekDat,
Sales
Resident Table2;
May be like this
Table1:
LOAD ID, Sales,
Store,
Text(WeekDay(Date)) as WeekDay, // Mon, Tue, etc.
from source_1;
CrossTable(WeekDay, Sales, 2)
Table2:
LOAD ID,
Store
Monday as Mon,
Tuesday as Tue,
Wednesday as Wed
.. etc.
from source_2;
Or this
Table1:
LOAD ID, Sales,
Store,
WeekDay(Date) as WeekDay, // Mon, Tue, etc.
from source_1;
Table2:
CrossTable(Week, Sales, 2)
LOAD ID,
Store
Monday as Mon,
Tuesday as Tue,
Wednesday as Wed
.. etc.
from source_2;
Concatenate (Table1)
LOAD ID,
Store,
Dual(Week, Match(Week, 'Mon', 'Tue', 'Wed', 'Thur', 'Fri', 'Sat', 'Sun')) as WeekDat,
Sales
Resident Table2;
DROP Table Table2;
Thank you for the quick response!
I've chosen the second. I'm afraid but It doesn't work correctly. How to fix them?
What is the issue you run into?
I've got two Sundays by the second one. Why? 😃 It isn't correct
By the second one? Can you show this in an image?
There is a list with two Sundays.
Try this
Concatenate (Table1)
LOAD ID,
Store,
Dual(Week, (Match(Week, 'Sun', 'Mon', 'Tue', 'Wed', 'Thur', 'Fri', 'Sat') - 1)) as WeekDat,
Sales
Resident Table2;
Two Saturdays . What's wrong?!
Can you run this for me
Table1:
LOAD ID, Sales,
Store,
WeekDay(Date) as WeekDay, // Mon, Tue, etc.
Num(WeekDay(Date)) as WeekDayNum
from source_1;
and then create a table box with WeekDay and WeekDayNum fields and share a screenshot
Don't add the crosstable load after this...