Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for Data Integration and Data Analytics gurus. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

Ranking in Script

Hi,

I need help with this Rank situation (Aggr with Dimensions) and it must be made on Script (Not in set analysis).

Situation:

PlatformSiteValue
MobileEN100
MobileIL300
MobileDE150
PCEN200
PCIL400
PCDE600
CryptoEN400
CryptoIL300
CryptoDE

100

Wanted Result:

 

PlatformSiteValueRank
MobileEN1003
MobileIL3001
MobileDE1502
PCEN2003
PCIL4002
PCDE6001
CryptoEN4001
CryptoIL3002
CryptoDE1003
Tags (2)
1 Solution

Accepted Solutions
Highlighted

Re: Ranking in Script

Change them like this and see if it works

AutoNumber(Weeklypageviews, Product&domain_ID&1) AS Weeklypageviews_Rank

AutoNumber(Weeklyvisits, Product&domain_ID&2) AS Weeklyvisits_Rank

AutoNumber(Weeklyvisitors, Product&domain_ID&3) AS Weeklyvisitors_Rank

View solution in original post

11 Replies
Highlighted
MVP
MVP

Re: Ranking in Script

Try like:

T1:

Load * Inline [

Platform, Site, Value

Mobile, EN, 100

Mobile, IL, 300

Mobile, DE, 150

PC, EN, 200

PC, IL, 400

PC, DE, 600

Crypto, EN, 400

Crypto, IL, 300

Crypto, DE, 100];


Join


Load

  Platform, Site,

    AutoNumber( Rowno(), Platform) as Rank

Resident T1 Order By Value;

Capture.JPG

Highlighted

Re: Ranking in Script

Hi Meitar,

Data:

LOAD * INLINE [

    Platform, Site, Value

    Mobile, EN, 100

    Mobile, IL, 300

    Mobile, DE, 150

    PC, EN, 200

    PC, IL, 400

    PC, DE, 600

    Crypto, EN, 400

    Crypto, IL, 300

    Crypto, DE, 100

];

Result:

Load *,

AutoNumber(Value, Platform) as Rank

Resident Data

Order By Platform, Value desc;

DROP Table Data;

Highlighted
Creator III
Creator III

Re: Ranking in Script

try this:

Situation:


load * Inline [

Platform, Site, Value

Mobile, EN, 100

Mobile, IL, 300

Mobile, DE, 150

PC, EN, 200

PC, IL, 400

PC, DE, 600

Crypto, EN, 400

Crypto, IL, 300

Crypto, DE, 100


];


abc:

load Site, sum(Value)as Valuee1 Resident Situation Group by Site;




load Site,Valuee1,RowNo() as rank Resident abc Order by Valuee1 desc;


DROP Table abc;

Highlighted
Contributor III
Contributor III

Re: Ranking in Script

It's correct for 1 Measure (Value).

When I'm trying to this on more than one measure I don't succeed- Only for the first Measure

(As I read it because of AutoNumber function).

Any solution for that?

Highlighted

Re: Ranking in Script

Would you be able to elaborate on your concern?

Highlighted
Contributor III
Contributor III

Re: Ranking in Script

autonumber.png

Highlighted
Contributor III
Contributor III

Re: Ranking in Script

As I Read maybe it's because of Autonumber (Need to reset it somehow)

Highlighted

Re: Ranking in Script

Change them like this and see if it works

AutoNumber(Weeklypageviews, Product&domain_ID&1) AS Weeklypageviews_Rank

AutoNumber(Weeklyvisits, Product&domain_ID&2) AS Weeklyvisits_Rank

AutoNumber(Weeklyvisitors, Product&domain_ID&3) AS Weeklyvisitors_Rank

View solution in original post

Highlighted
Master III
Master III

Re: Ranking in Script

Complete your joins first into a temp table

and try autounumber on the final table

hth

Sasi