Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Data coming from two data sources

Hi Guys,

Data are coming from two sources. I want to create a data model in such a way that in checks for current month and for current month data is coming from data source A and if month is not the current month data is coming from data source B.

How can i achieve this ?

Thanks,

Girish Inani

5 Replies
sushil353
Master II
Master II

Hi,

Yes, you can achieve this! try something like below:

let vDateCheck  =num(Monthname(Today()))

Temp:

load Max(Date) as sDate

from SourceA;

let vSourceDateCheck = peek('sDate',0,'Temp')

if vDateCheck = vSourceDateCheck then

load * from sourceA;

else

load * from sourceB;

HTH

Anil_Babu_Samineni

Girish Inani wrote:

Data are coming from two sources. I want to create a data model in such a way that in checks for current month and for current month data is coming from data source A and if month is not the current month data is coming from data source B.

How can i achieve this ?

Try Something like this, If possible please try to share few data how fields data looking?

If Month = Max(Month) THEN

SourceA:

Load *, Month From SourceA;

ElseIf

SourceB:

Load *, Month From SourceB;

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Not applicable
Author

Thanks for your reply.

I want the data for all the months, just the current month data should be from Data source A while for previous months the data should be from Data source B.

stabben23
Partner - Master
Partner - Master

Hi,

I should build two variables in script that holds previous month and current month and use them in the where statment.

Anil_Babu_Samineni

I don;t think so does it work for you

How about by using Qualify & UnQualify

Qualify *;

SourceA:

Load *, Month From SourceA;

UnQualify Month;

Qualify *;

SourceB:

Load *, Month From SourceB;

UnQualify Month;


Then Create Straight Table by using Dim

And Expression seems this


just the current month data should be from Data source A while for previous months the data should be from Data source B.


Sum({<SourceA.Month = {'$(=Max(SourceA.Month))'}, SourceB.Month = {'$(=AddMonths(Max(SourceB.Month),-1))'}>} Sales)

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)