Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
I have a table Employee which contains dtmAddedOn (getdate field with current date).I do fetch data from SQLSERVER to QVD Generator.
If i don't have Current date in dtmAddedOn column ,my QVD Generator should not Reload the script.it has to exit the script.
Could you please suggest me some way to sort out the issue.
Intention of the event of refresh failure we are at least able to retain a day’s old data and don’t wipe out data completely from the dashboard
Inadvance
Thank you
Before executing the store instruction, do a query to select dtmAddedOn and count it (something like select count(dtmAddedOn) from ....
then with peek function verify that a value exists, store the result in a variable and with it use an if condition before the store.
Hope it is clear
Can i get some example on this one!!
Tab1:
LOAD * Inline [
Fld1, Fld2, Date
a,aa,
b,bb,
c,cc,
];
// As you can see there isn't any date.
Temp:
LOAD Sum(If(IsNull(Date) or Trim(Date)='',0,1)) as dates Resident Tab1;
Let totDates = Peek('dates',0,'Temp');
IF $(totDates) > 0 then
STORE * from Tab1 into tab.qvd;
ENDIF
I tried this one but no luck.Could you pls guide whts wrong in the below Load.In all the case my script is getting executed.
Tab1:
LOAD Date(Date#([dtmAddedOn],'YYYY-MM-DD'),'DD/MM/YYYY') as dtmAddedOn;
SQL SELECT CAST(dtmAddedOn As DATE) as dtmAddedOn
FROM "Sales_UAT".dbo."Fact_Opportunity";
Temp:
LOAD Sum(If(IsNull(dtmAddedOn) or Trim(dtmAddedOn)='',0,1)) as dates Resident Tab1;
Let totDates = Peek('dates',0,'Temp');
IF $(totDates) > 0 then
STORE * from Tab1 into tab.qvd;
ENDIF
Try with:
Tab1:
SELECT Count(dtmAddedOn) as dtmAddedOn
FROM "Sales_UAT".dbo."Fact_Opportunity" where not dtmAddedOn is null;
Let totDates = Peek('dtmAddedOn',0,'Tab1');
IF $(totDates) > 0 then
STORE * from Tab1 into tab.qvd;
ENDIF
let me know
Tab1:
LOAD Date(Date#([dtmAddedOn],'YYYY-MM-DD'),'DD/MM/YYYY') as dtmAddedOn;
SQL SELECT CAST(dtmAddedOn As DATE) as dtmAddedOn
FROM "Sales_UAT".dbo."Fact_Opportunity";
Temp:
LOAD count(dtmAddedOn) as dateCount Resident Tab1 where len(trim(dtmAddedOn))>0;
Let totDates = Peek('dateCount',0,'Temp');
IF $(totDates) > 0 then
STORE * from Tab1 into tab.qvd;
ENDIF
try,
Tab1:
LOAD Date(Date#([dtmAddedOn],'YYYY-MM-DD'),'DD/MM/YYYY') as dtmAddedOn;
SQL SELECT CAST(dtmAddedOn As DATE) as dtmAddedOn
FROM "Sales_UAT".dbo."Fact_Opportunity";
Temp:
LOAD distinct sum(If(len(trim(dtmAddedOn))=0,0,1)) as dates Resident Tab1;
Let totDates = Peek('dates',0,'Temp');
IF len('$(totDates)' ) > 0 then
STORE * from Tab1 into tab.qvd;
ENDIF
Thanks for the prompt response SasiParupudi1 & Kush141087
No luck,One thing I want to clear that Fact_Opportunity table contains all the records have same date..I mean 1000 Records have the same date
After condition failing script is getting executed.Some where its has to exit script right
Header 1 | Header 2 | dtmAddedon |
---|---|---|
XYZ | Delhi | 09/08/20115 |
ABC | MUMBAI | 09/08/20115 |