Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Distinct numbering in chart expression

Hi all,

I’m struggling with something in QlikView and I hoped you could help me.

I’m trying to ‘AutoGenerate’ distinct values/numbers not during the load script, but in a chart expression (the reason is that the numbering depends on the currently shown items, based on user selection, and thus cannot be calculated during the load script).

For example:

I load a table that looks like this:

USA          USD

Australia    AUD

France      EUR

Spain        EUR

Japan        JPY

Italy          EUR

and the chart (say, straight table) should look like:

USD   1

EUR   2

EUR   2

AUD   3

USD   1

AUD   3

EUR   2

each value that is shown based on the current selection gets a unique number.

How can I do that in the chart expression? Using the Rank() function got me close but not quite there.

Thank you!

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Hi itaymaor82,

just for interest, what is your expression approach using Rank()? That was also one of my first ideas..

Try this:

=aggr(NODISTINCT RowNo(),CURR)

if CURR is the fieldname of your currencies.

Hope this helps,

Stefan

View solution in original post

2 Replies
swuehl
MVP
MVP

Hi itaymaor82,

just for interest, what is your expression approach using Rank()? That was also one of my first ideas..

Try this:

=aggr(NODISTINCT RowNo(),CURR)

if CURR is the fieldname of your currencies.

Hope this helps,

Stefan

Not applicable
Author

It works! Thanks so much!