Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Rename name in Dimension

Hi guys,

I'd like to dynamically rename of tags in a dimension.

When I click on any ID from list box ID, in the chart "Output" selected ID should called "0", previous 2 ID - "-1", "-2" and next 2 ID "+1","+2"

Capture.PNG

Please find attached file.

Thanks,

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

I resolved the issue.

I created a varaible vDRank=Aggr(Rank(-only({<ID=,FI_ID={">=$(=max(FI_ID)-2)<=$(=max(FI_ID)+2)"}>}ID)), ID)

In dimension:

Aggr(Rank(-only({<ID=,FI_ID={">=$(=max(FI_ID)-2)<=$(=max(FI_ID)+2)"}>}ID)), ID)-vDRank

View solution in original post

9 Replies
julian_rodriguez
Partner - Specialist
Partner - Specialist

Hello Vladimir

May be this calculated dimension works for you:

=Aggr(Rank(only({<ID=,FI_ID={">=$(=max(FI_ID)-2)<=$(=max(FI_ID)+2)"}>}Text)), ID)-3

20141218.JPG

Regards!

Anonymous
Not applicable
Author

Thanks for helping.

Order should be appositive.

Actually I need to add wording like step-1, step-2 and so on.

If it's not doable, I can use only numbers

Anonymous
Not applicable
Author

I fixed the appositive order

=Aggr(Rank(-only({<ID=,FI_ID={">=$(=max(FI_ID)-2)<=$(=max(FI_ID)+2)"}>}ID)), ID)-3

but I have problem when I select the first number, it should be RANK -1

=Aggr(Rank(only({<ID=,FI_ID={">=$(=max(FI_ID)-2)<=$(=max(FI_ID)+2)"}>}Text)), ID)-1


if I select the second number, it should be RANK -2

=Aggr(Rank(only({<ID=,FI_ID={">=$(=max(FI_ID)-2)<=$(=max(FI_ID)+2)"}>}Text)), ID)-2


How to easy combine 3 conditions?

Please attached my file.


Anonymous
Not applicable
Author

I found out how to do with condition

IF(COUNT(TOTAL({<ID=,FI_ID={">=$(=max(FI_ID)-2)<=$(=max(FI_ID)+2)"}>}ID)=1,

Aggr(Rank(only({<ID=,FI_ID={">=$(=max(FI_ID)-2)<=$(=max(FI_ID)+2)"}>}Text)), ID)-1,

IF(COUNT(TOTAL({<ID=,FI_ID={">=$(=max(FI_ID)-2)<=$(=max(FI_ID)+2)"}>}ID)=2,

Aggr(Rank(only({<ID=,FI_ID={">=$(=max(FI_ID)-2)<=$(=max(FI_ID)+2)"}>}Text)), ID)-2,

IF(COUNT(TOTAL({<ID=,FI_ID={">=$(=max(FI_ID)-2)<=$(=max(FI_ID)+2)"}>}ID)>=3,

Aggr(Rank(only({<ID=,FI_ID={">=$(=max(FI_ID)-2)<=$(=max(FI_ID)+2)"}>}Text)), ID)-3)))

It works.

But it doesn't work in some my cases.

Because key ID sometimes doesn't match with position

Capture.PNG

Maybe something like this

only({<ID=,FI_ID={">=$(=max(FI_ID)-2)<=$(=max(FI_ID)+2)"}>}

IF(ID=ID,'Step',

IF(ID-1=ID-1,'Step-1',

IF(ID+1=ID+1,'Step+1')))

)

Anonymous
Not applicable
Author

Is it possible to add a condition like if ID take place number 1 in the rank position, do this???

Anonymous
Not applicable
Author

What condition possible to add to get it?

Capture.PNG

Anonymous
Not applicable
Author

maybe firstvalue() or firstindex() or firstsortedvalue()

????????????????????????????????

Anonymous
Not applicable
Author

Any ideas, guys?

Maybe use pick() , when ID takes 1 or 2 places, use the same rank expression just -1 or -2.

Anonymous
Not applicable
Author

I resolved the issue.

I created a varaible vDRank=Aggr(Rank(-only({<ID=,FI_ID={">=$(=max(FI_ID)-2)<=$(=max(FI_ID)+2)"}>}ID)), ID)

In dimension:

Aggr(Rank(-only({<ID=,FI_ID={">=$(=max(FI_ID)-2)<=$(=max(FI_ID)+2)"}>}ID)), ID)-vDRank