Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
evgeniyita
Creator
Creator

Concatenate two tables with focus on WeekDay

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

1 Solution

Accepted Solutions
sunny_talwar

Try this

Concatenate (Table1)

LOAD ID,

     Store,

     Dual(Week, (Match(Week, 'Sun', 'Mon', 'Tue', 'Wed', 'Thur', 'Fri', 'Sat') - 1)) as WeekDat,

     Sales

Resident Table2;

View solution in original post

10 Replies
sunny_talwar

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;

evgeniyita
Creator
Creator
Author

Thank you for the quick response!

I've chosen the second.  I'm afraid but It doesn't work correctly. How to fix them?

sunny_talwar

What is the issue you run into?

evgeniyita
Creator
Creator
Author

I've got two Sundays by the second one. Why? 😃  It isn't correct

sunny_talwar

By the second one? Can you show this in an image?

evgeniyita
Creator
Creator
Author

There is a list with two Sundays.

sunny_talwar

Try this

Concatenate (Table1)

LOAD ID,

     Store,

     Dual(Week, (Match(Week, 'Sun', 'Mon', 'Tue', 'Wed', 'Thur', 'Fri', 'Sat') - 1)) as WeekDat,

     Sales

Resident Table2;

View solution in original post

evgeniyita
Creator
Creator
Author

Two Saturdays . What's wrong?!

sunny_talwar

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...