Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
umashankarus
Contributor III
Contributor III

Pick random value for a dimension

Hi Experts,

I have table data as below

Number     Description

1               Description1

1               Description2

1               Description3

2               Description21

3               Description31

4               Description32

Expected Result - to pick any one of the description against the number

Number      Description

1                 Description1

2                 Description21

3                 Description32

Can we use below expression ?

=AGGR(Pick(1, [Description]),Number)

Thanks


3 Replies
vishsaggi
Champion III
Champion III

may be try this?

Random:

LOAD *

Where RandNum = 1;

LOAD *,

     Number&Description AS NumDesc,

     AutoNumber(Number&Description, Number) As RandNum INLINE [

Number,     Description

1,               Description1

1,               Description2

1,               Description3

2,               Description21

3,               Description31

4,               Description32

];

tamilarasu
Champion
Champion

If you really want to use calculated dimension then try,

=AGGR(FirstSortedValue(Distinct [Description],Number),Number)

fabdulazeez
Partner - Creator III
Partner - Creator III

Create a Table Chart

Dimension : Number

Measure  : MaxString(Description)