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

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

new to qlikview

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

Labels (1)
5 Replies
Not applicable
Author

You can try this


LOAD *
where Group='CAR';
LOAD
left(sku,5) AS Group,
sku
from table.qvd (qvd);


Miguel_Angel_Baeyens

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

Not applicable
Author

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 *





Miguel_Angel_Baeyens

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?

villafuerte
Partner Ambassador
Partner Ambassador

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!