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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help in script

Good morning All,

I have the following script:

[FY2013 NL TRANS]:LOAD CostCentre,
   
ExpenseCode,
   
Suffix,
   
Date(PostingDate)                    as Date,
   
Month(PostingDate)                   as Month,
   
Year(PostingDate)                    as Year,
   
Narrative,
   
BaseValue                            as [FY13 Value],
   
CompanyKey
   
where ExpenseCode >='8000'
   
and (CompanyKey ='01' or CompanyKey ='20' or CompanyKey ='25' or CompanyKey ='29' or CompanyKey ='32' or CompanyKey ='36');SQL SELECT CostCentre,
    ExpenseCode,
    Suffix,
    PostingDate,
    Narrative,
    BaseValue,
    CompanyKey
FROM "EIE_DW".dbo."NL_00_OTRAN";

The data that pulls through are for 2012 and 2013, I only want to work with 2013 data.

How can I specify this in my script?

Thanks

*R*

1 Solution

Accepted Solutions
its_anandrjs
Champion III
Champion III

Change in load script like

[FY2013 NL TRANS]:LOAD CostCentre,
   
ExpenseCode,
   
Suffix,
   
Date(PostingDate)                    as Date,
   
Month(PostingDate)                   as Month,
   
Year(PostingDate)                    as Year,
   
Narrative,
   
BaseValue                            as [FY13 Value],
   
CompanyKey
   
where ExpenseCode >='8000'
   
and (CompanyKey ='01' or CompanyKey ='20' or CompanyKey ='25' or CompanyKey ='29' orCompanyKey ='32' or CompanyKey ='36') and Year(PostingDate) = '2013' ;SQL SELECT CostCentre,
    ExpenseCode,
    Suffix,
    PostingDate,
    Narrative,
    BaseValue,
    CompanyKey
FROM "EIE_DW".dbo."NL_00_OTRAN";

View solution in original post

5 Replies
MK_QSL
MVP
MVP

FY2013 NL TRANS]:

LOAD CostCentre,
   
ExpenseCode,
   
Suffix,
   
Date(PostingDate)                    as Date,
   
Month(PostingDate)                   as Month,
   
Year(PostingDate)                    as Year,
   
Narrative,
   
BaseValue                            as [FY13 Value],
   
CompanyKey;

SQL SELECT CostCentre,
    ExpenseCode,
    Suffix,
    PostingDate,
    Narrative,
    BaseValue,
    CompanyKey
FROM "EIE_DW".dbo."NL_00_OTRAN"

Where CompanyKey in ('01','20','25','29','32','36' and ExpenseCode >='8000' and

PostingDate >= '2013-01-01' and PostingDate <= '2013-12-31'


You can change Date as per your System Date...

ThornOfCrowns
Specialist II
Specialist II

PostingDate >= '2013-01-01' and PostingDate <= '2013-12-31'

will only pull 2013 data.

its_anandrjs
Champion III
Champion III

Change in load script like

[FY2013 NL TRANS]:LOAD CostCentre,
   
ExpenseCode,
   
Suffix,
   
Date(PostingDate)                    as Date,
   
Month(PostingDate)                   as Month,
   
Year(PostingDate)                    as Year,
   
Narrative,
   
BaseValue                            as [FY13 Value],
   
CompanyKey
   
where ExpenseCode >='8000'
   
and (CompanyKey ='01' or CompanyKey ='20' or CompanyKey ='25' or CompanyKey ='29' orCompanyKey ='32' or CompanyKey ='36') and Year(PostingDate) = '2013' ;SQL SELECT CostCentre,
    ExpenseCode,
    Suffix,
    PostingDate,
    Narrative,
    BaseValue,
    CompanyKey
FROM "EIE_DW".dbo."NL_00_OTRAN";

senpradip007
Specialist III
Specialist III

PostingDate Between '2013-01-01' and '2013-12-31'

will load 2013 data.

Not applicable
Author

Thank Anand,

It works!