Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
harleen_singh
Creator III
Creator III

rank to zero sales

In straight table,

If sum(sales)=0 than rank function returning null values but i want to assign same rank to all zero values like this

Dim  Sales Rank

abc   50      1

cde   20      2

fgh    0        3

ijk     0        3

xyz   -1       4

which is not happening in my case instead of 3 i am getting null value

1 Reply
marcus_sommer

For me it worked:

load Dim, num(Sales) as Sales inline [

Dim,  Sales, Rank

abc,   50,      1

cde,   20,      2

fgh,    0,        3

ijk,     0,        3

xyz,   -1,       4

] ;

- Marcus