Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

johnsmithqv
New Contributor III

top 10 Range in script


Hi,

I need to load only the top10 Quarter Sales  and need to do this in scripting .

Suggest me

6 Replies
martinpohl
Valued Contributor II

Re: top 10 Range in script

find attached

sujeetsingh
Honored Contributor III

Re: top 10 Range in script

Write condition as where rank <=10

You can derieve ranks by RANK() function.

johnsmithqv
New Contributor III

Re: top 10 Range in script

Hi Martin,

that is not up to the requirement.

what we want is 2014(Q1-Q4) ,2013(Q1-Q4), 2012(Q3,Q4) as these are top 3 years and associated Quarters

we want only 10 Q's

martinpohl
Valued Contributor II

Re: top 10 Range in script

don't understand.

the top years are 2014, 2013 and 2009

please define what quarters are wanted.

as you wrote top 3 years and 10 quarters, but one year is having 4 quarters = 12 quarters for 3 years

johnsmithqv
New Contributor III

Re: top 10 Range in script

Hi,

I need to optimize my load I want to laod only 2014(Q1-Q4), 2013(Q1-Q4) and 2012(Q3,Q4)

these are maximum year Quarters. So, I need them

hope this time you understand a bit clear

anbu1984
Honored Contributor III

Re: top 10 Range in script

So you need maximum year quarters irrespective of sales?

Temp:

LOAD Year,

     Quarter,

     Sales

FROM

[NEw.xlsx]

(ooxml, embedded labels, table is A, filters(

Replace(1, top, StrCnd(null))

));

NoConcatenate

Final:

First 10 Load * Resident Temp Order by Quarter Desc;

Drop table Temp;

Community Browser