Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
divya_anand
Creator III
Creator III

Sequential number instead of Dimension values

Hi,

I am working on a line chart which has ID on X-axis and "no of days open" on Y-axis.

I am trying to name these IDs in numbers like this-

Any idea as to how to name these IDs in numbers?

25 Replies
effinty2112
Master
Master

Hi Divya,

Maybe:

Aggr(Dual(ID,Rank(Expression)),ID)

Good luck

Andrew

qv_testing
Specialist II
Specialist II

Try this,

Make one composite key Script level...

RowNo() &'-'&YourFields as NewField


and in your chart Dimension

SubField(NewField,'-', 1)


OR


Only take RowNo() as Key in script

and in your chart Dimension

SubField(Key&'-'&YourDimension,'-', 1)


Capture.JPG


Good luck

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

How are the IDs currently sorted on the Xaxis?

-Rob

divya_anand
Creator III
Creator III
Author

Rob,

The IDs are supposed to be sorted in descending order of "No. of days open". So all the IDs which have higher value for "No. of days open" will appear on the left and the line will gradually drop because all the IDs with lower value of "No. of days open" will appear on the right side of the chart.

Irrespective of which ID is on X-axis, it has to be numbered 1,2,3.... from left to right. This will help users get a count of IDs instead of the IDs itself.

Thank you.

tresesco
MVP
MVP

If you are using qv12.x or qlik sense, you could probably use sortable aggr() to achieve this.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I would try Andrew's suggestion below.

-Rob

divya_anand
Creator III
Creator III
Author

Hi Andrew,

I tried this on sample data, it still shows the ID itself on X-axis. I want it to be named 1,2,3,4..... on the chart.

PFA the sample qvw.

Could you please check & let me know if any change is to be made?

Thank you.

divya_anand
Creator III
Creator III
Author

Hi Marco,

I've attached a sample QVW in a reply to Andrew below.

Please let me know if you need more information.

Thank you.

tresesco
MVP
MVP

This?

divya_anand
Creator III
Creator III
Author

Hi Tresesco,

Thank you for the quick response.

I see that you have considered RowNo() to number them based on load order, right?

But can we make this chart to show values in descending order like this-

Yet name them 1,2,3,4... from left to right?

Is this possible?