Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
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;
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.
Hi,
I should build two variables in script that holds previous month and current month and use them in the where statment.
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)