Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help with Load Script

Load Script.JPG

I have a list of customers which I need to segregate based on the unique customers in each channels which comes from an excel file, refer the above screenshot. I have this built in chart but as this requires aggregation of millions of rows chart ends up eating the entire RAM and make the app very slow, please help.

I want customer 2 and 3 to be marked as Phone_Only and 5 as Web only and remaining as Web and Phone.

Thanks for your help!

Nidhish

1 Solution

Accepted Solutions
sunny_talwar

May be something like this:

Capture.PNG

Script:

Table:

LOAD * Inline [

Cus, Channel

1, Phone

1, Web

2, Phone

3, Phone

4, Phone

4, Web

5, Web

];

Join(Table)

LOAD Distinct Cus,

  Concat(Channel, '|') as GroupedChannel

Resident Table

Group By Cus;

FinalTable:

LOAD Cus as Customer_Phone_Only,

  Channel

Resident Table

Where WildMatch(GroupedChannel, '*Phone*') and not WildMatch(GroupedChannel, '*Web*');

Concatenate (FinalTable)

LOAD Cus as Customer_Web_Only,

  Channel

Resident Table

Where not WildMatch(GroupedChannel, '*Phone*') and WildMatch(GroupedChannel, '*Web*');

Concatenate (FinalTable)

LOAD Cus as Customer_Web_and_Phone,

  Channel

Resident Table

Where WildMatch(GroupedChannel, '*Phone*') and WildMatch(GroupedChannel, '*Web*');

DROP Table Table;

View solution in original post

4 Replies
sunny_talwar

May be something like this:

Capture.PNG

Script:

Table:

LOAD * Inline [

Cus, Channel

1, Phone

1, Web

2, Phone

3, Phone

4, Phone

4, Web

5, Web

];

Join(Table)

LOAD Distinct Cus,

  Concat(Channel, '|') as GroupedChannel

Resident Table

Group By Cus;

FinalTable:

LOAD Cus as Customer_Phone_Only,

  Channel

Resident Table

Where WildMatch(GroupedChannel, '*Phone*') and not WildMatch(GroupedChannel, '*Web*');

Concatenate (FinalTable)

LOAD Cus as Customer_Web_Only,

  Channel

Resident Table

Where not WildMatch(GroupedChannel, '*Phone*') and WildMatch(GroupedChannel, '*Web*');

Concatenate (FinalTable)

LOAD Cus as Customer_Web_and_Phone,

  Channel

Resident Table

Where WildMatch(GroupedChannel, '*Phone*') and WildMatch(GroupedChannel, '*Web*');

DROP Table Table;

crystles
Partner - Creator III
Partner - Creator III

Can you provide a picture of the table structure from the table view? How are the three tables linked?

Anonymous
Not applicable
Author

You may need to sort this in your load script to get a flag in your fact table for :

  • Phone Only
  • Web Only
  • Both

Then you won't need any front end aggregations.

Not applicable
Author

This worked, and I was able to find one more workaround, thanks a lot for the quick help!