Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

jenmclean
New Contributor II

SQL Load statement question

I am trying to optimize qvd's and need to pull info from a SQL table but only transactions that are have an ID of 1 17. My code is below:

TransactionDetails:
SQL SELECT "DET_AcctID",
    "DET_Amount",
    "DET_BackOrderQty",
    "DET_BRDSysID",
    "DET_BridgeSessionID",
    "DET_CC_AddressID",
    "DET_CC_ApprovalCode",
    "DET_CC_CardType",
    "DET_CC_DebitCreditFlag",
    "DET_CC_SwipeFlag",
    "DET_CCP_SysID",
    "DET_CGS_CompleteFlag",
    "DET_CGSCostAmt",
    "DET_Closing_TransFlag",
    "DET_ContractID",
    "DET_CRLSysID",
    "DET_Deposited",
    "DET_Description",
    "DET_Detail_CGSID",
    "DET_DetID",
    "DET_DetSubtypeID",
    "DET_DetTypeID",
    "DET_DSRSysID",
    "DET_EstimateGrpID",
    "DET_ExpDateTime",
    "DET_FET",
    "DET_GenRef",
    "DET_Hours",
    "DET_LineItemTypeID",
    "DET_MechID",
    "DET_MercTransactionID",
    "DET_OnHandFlag",
    "DET_PackageID",
    "DET_PartID",
    "DET_PrintFlag",
    "DET_Qty",
    "DET_Qty_Costed",
    "DET_SalesPersonID",
    "DET_SiteID",
    "DET_SortID",
    "DET_TransID",
    "DET_TransTypeID",
    "DET_UnitCostBase",
    "DET_UnitCostLast",
    "DET_VendBRDSysID"
FROM "databasename".dbo.Details
WHERE "DET_TransTypeID"='1' and '17';

Store * FROM TransactionDetails Into (txt);

I have tried many variations to get it to pull only this data, I can get it to do 1 or 17 but not both of them together.

Having a brain meltdown on this one...any help is much appreciated.

JM

1 Solution

Accepted Solutions
Not applicable

Re: SQL Load statement question

Hi. How can the field be both 1 and 17 at the same time? Dont you mean this?

WHERE "DET_TransTypeID"='1' or "DET_TransTypeID"='17';

3 Replies
Not applicable

Re: SQL Load statement question

Hi. How can the field be both 1 and 17 at the same time? Dont you mean this?

WHERE "DET_TransTypeID"='1' or "DET_TransTypeID"='17';

jenmclean
New Contributor II

Re: SQL Load statement question

This column has several numbers in it to deliniate Transaction Type; a 1 is an invoice and 17 is a credit. I do not need or want any other data from this table. It will then be joined with other data.

The current QVD that has all of this data pulled together is 1.5GB. I am trying to elimiate unneccesary data.

Not applicable

Re: SQL Load statement question

Ok then maybe you need to do a Group By DET_AcctID to get the accounts that have both the transactions, 1 and 17.

Community Browser