Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Upon creating a field using AS...how do I select only a few "items" from that newly created field.
example:
left(sku,5) AS Group...then...Group = 'CAR'
thank you
pasq
You can try this
LOAD *
where Group='CAR';
LOAD
left(sku,5) AS Group,
sku
from table.qvd (qvd);
Hello Pasq,
Although it's not a must, it's highly recommendable to do a precedent load (that is, hardcode the fields and functions you will use before the actual SQL SELECT statement). Actually writing this LOAD statement allows yo to use all functions provided by QlikView, (it's not SQL, sometimes similar though...).
So you can do something like the following in your script editor:
Table: // The label of the table is going to be loaded into QlikViewLOAD If(Left(sku, 5) = 'AAA', 'CAR', 'Others') AS Group, // newly created field from another field Field2, // some other fields Field3;SQL SELECT sku, Field2, Field3 FROM database.table; // the select as you perform in your query analyzer
There are some other functions such as ApplyMap or Match() to load some but not all records.
Hope that helps
gents-
Thank you...but I am REALLY new to Qlikview
I want to "filter" out on the BRAND that is Cartier or Patek or Rolex.
Here is my LOAD statement...with newly created fields:
LOAD
sls1,
slsname
,
transdate
,
slsblock
,
type
,
custnum
,
custname
,
vendor
,
dept
,
sku
,
LEFT
(sku,3) AS BrandX,
IF
((LEFT(sku,3))='CAR','CARTIER',if((LEFT(sku,3))='PAT','PATEK',if((LEFT(sku,3))='ROL','ROLEX',' '))) AS BRAND,
LEFT
(sku,5) AS Group,
perce
,
splits
,
sls2
,
sls3
,
trds
,
qty
,
retail
,
sold
,
disctype
,
"disc %"
,
"comm$"
,
mgrpool
,
commipaid
,
Penalization
,
TotalCommission
,
ItemDescription
,
VendorName
,
WasOnSale
,
SalePrice
,
LocationNum
,
DiscountPercentage
,
NetSalesDols
,
THPriceExtension
,
THPreTotDiscountExt
,
THDiscount
,
THTradeInDolsApplied
,
THTotalAmount
,
"tradeins?"
,
if
("tradeins?"='Y',sold,retail) AS RevRetail,
NDate
;
SQL
SELECT *
That seems fine to me.
Now go to the sheet background, right click, select New Sheet Object and select the BRAND field. You will see four values (the three you set plus the blank).
Is that right?
Hi,
If you want to use this filter right away, maybe you can try this:
LOAD
ProductName,
Category,
SKU
FROM Table
WHERE left(sku,5)='CAR';
Or you can create the table an then use the filter in a RESIDENT load.
Hope it helps!