Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
deepakqlikview_123
Specialist
Specialist

Data model


Hello Expert,

PFA.

Can you please suggest how to build data model for this.

Thanks,

Deepak

1 Solution

Accepted Solutions
Not applicable

Hi

Load this script in you application.

Click:

LOAD Date(EmailOpenTime) as EmailOpenTime,

     [Customer id] as Customer,

     Month,    

     Year,

     Clicked

FROM

C:\Users\windows\Desktop\QVDS\Click.qvd

(qvd);

Campaign:

LOAD [Campaign id],

     Start,

     End ,

     Name,

     Cost

FROM

C:\Users\windows\Desktop\QVDS\Campaign.qvd

(qvd)

where [Campaign id] <> '' ;;

Join

IntervalMatch (EmailOpenTime)

LOAD Start,

     End as CampingEndDate

Resident Campaign;

Customer:

LOAD Customer,

     Age,

     Country,

     Gender

FROM

C:\Users\windows\Desktop\QVDS\Customers.qvd

(qvd);

View solution in original post

14 Replies
puttemans
Specialist
Specialist

Hi,

You need to find the common links first, and make sure there is only 1. I guess that customer and customer ID will contain the same information, so by renaming one of them similar to the other in the load statement, you create a link within QV. If you only have 1 campaign every month, then the start field of the campaign may be linked with the month field in clicks. If that is not the case, then you need to look further into your data (I don't know them). If you do not find a good connector, then you may need to create one first if that's possible.

Regards,

Not applicable

upload a sample of each table and I will tell you

Cheers,

Byron

vikasmahajan

Hii

Please find sample application will help you build data model.

  Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
deepakqlikview_123
Specialist
Specialist
Author

Hello Bryn

Cliks table

EmailOpenTime Customer idMonthYearClicked
12/29/2012 12:001122012Clicked
2/2/2013 12:00222013No Click
3/2/2013 7:00332013Clicked
12/25/2012 16:154122012Clicked
12/26/2012 16:155122012Clicked
12/27/2012 16:156122012No Click
12/28/2012 16:157122012Clicked
12/29/2012 16:158122012Clicked
12/30/2012 16:159122012No Click
12/31/2012 16:1510122012Clicked
1/1/2013 16:151112013Clicked
1/2/2013 16:151212013Clicked
1/3/2013 16:151312013Clicked
1/4/2013 16:151412013Clicked
1/5/201316:151512013No Click
1/6/2013 16:151612013Clicked
3/7/2013 16:151732013Clicked
1/8/2013 16:151812013No Click
1/9/2013 16:151912013Clicked

campaign table

Campaign
  id
StartEndName Cost
112/25/20121/2/2013XMAS50K
21/1/20131/29/2013JAN SALES75k

Customer table

CustomerAgeCountryGender
124UKMale
233FranceFemale
317GermanyMale
458UKMale
553UKFemale
633UKMale
755GermanyMale
842UKFemale
944UKMale
1045UKMale
1151UKFemale
1222UKMale
1324UKMale
1436GermanyFemale
1550UKMale
1612UKMale
1730UKFemale
1815UKMale
1912UKMale
2017GermanyFemale

 

can you please send me   screenshot for data model I do not have licenced version,

thanks

Deepak

Not applicable

Paste this code in your load script after you have done a load of the original tables

/***********************************************************************************

Step 1: Cleanup and Primary Key

***********************************************************************************/

CampaignFinal:

NoConcatenate

Load

  "Campaign id" as CampaignID,

  Alt(Date#(Start,'MM/DD/YYYY'),Start) as Start,

  Alt(Date#(End,'MM/DD/YYYY'),End) as End,

  Capitalize(Lower(Name)) as Name, //Cleaner look

  if(Right(Upper(Cost),1)='K',num(PurgeChar(Upper(Cost),'K'))*1000,num(Cost)) as Cost //Proper numberic formatting, assumed there is either a 1000 indicator i.e. k or straight value

Resident Campaign;

Drop Table Campaign;

CliksFinal:

Load

  CustomerID,

  Month,

  Year,

  EmailOpenTime,

  Date(Floor(EmailOpenTime)) as EmailOpenDate;

Load

  "Customer id" as CustomerID, //"Customer id" and Customer in Customers table are the same

  Month,

  Year,

  Alt(Date#(EmailOpenTime,'MM/DD/YYYY hh:mm'),EmailOpenTime) as EmailOpenTime

Resident Cliks;

Drop Table Cliks;

CustomersFinal:

NoConcatenate

Load

  Customer as CustomerID, //Customer and "Customer id" in Cliks table are the same

  Age,

  if(Country='UK','United Kingdom',Capitalize(Lower(Country))) as Country, //EU will now see a clean list box of full country name

  Capitalize(Lower(Gender)) as Gender //To ensure same text formatting

Resident Customers;

Drop Table Customers;

/***********************************************************************************

Final Step: Join Interval Match Table

***********************************************************************************/

IntervalMatch (EmailOpenTime)  // Create an interval link table to EmailOpenTime

JOIN (CampaignFinal)

StartEndDate:

Load

Start, End

Resident CampaignFinal;

exit script;

Not applicable

For those that don't have personal edition, here is the qvw

Capture.PNG.png

deepakqlikview_123
Specialist
Specialist
Author

Hi Byron,

Thanks it is very useful for me

Can u plz tell me what to do in below scenario

An online marketing team sends out two email campaigns to customers using their CRM system. The first is their Christmas campaign and the second is the New Year sales campaign.

You are asked to deliver an interactive dashboard to help the CEO analyse the performance of the email marketing campaign over Christmas and the New Year sales.

thanks

Not applicable

Hi

Load this script in you application.

Click:

LOAD Date(EmailOpenTime) as EmailOpenTime,

     [Customer id] as Customer,

     Month,    

     Year,

     Clicked

FROM

C:\Users\windows\Desktop\QVDS\Click.qvd

(qvd);

Campaign:

LOAD [Campaign id],

     Start,

     End ,

     Name,

     Cost

FROM

C:\Users\windows\Desktop\QVDS\Campaign.qvd

(qvd)

where [Campaign id] <> '' ;;

Join

IntervalMatch (EmailOpenTime)

LOAD Start,

     End as CampingEndDate

Resident Campaign;

Customer:

LOAD Customer,

     Age,

     Country,

     Gender

FROM

C:\Users\windows\Desktop\QVDS\Customers.qvd

(qvd);

Not applicable

Hi Deepak,

Its a pleasure. If the above solution is the right one, please mark it correct so others know as well.

With regards to your next quesiton, once again you need data which im sure they provided in the question. The question is quite simple; compare performance for the different campaigns.

Since the data will most probably share exactly the same fields with the exception that there should be a field that indicates which campaign, you would concatenate

Concatenate(Christmas)

LOAD *

Resident NewYear;

...or along those lines

Cheers,

Byron