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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
kklue
Contributor II
Contributor II

aggr only showed in the first dimension

hi guys,

I have this two inline tables, the aggr expression do not show as expected.

t1:
load * Inline [
id,m1,m2
a,1,10
b,3,4
c,5,5
d,7,9
e,10,10
f,11,12
g,12,13
h,13,13
i,1,3
j,21,1
];

t2:
load * Inline [
seg,seg_id
top2,1
top4,2
top6,3
top8,4
top10,5
];

 

why the dimension from top4 show 0? 10 is expected

kklue_0-1701315600219.png

 

Labels (2)
1 Solution

Accepted Solutions
PrashantSangle

I don't understand the logic which you try to implement, but if you want to repeat the value which you are getting in table then

try below expression

Count(Total aggr(rank(m1),id))

 

Regards,

Prashant Sangle

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

5 Replies
PrashantSangle

I don't understand the logic which you try to implement, but if you want to repeat the value which you are getting in table then

try below expression

Count(Total aggr(rank(m1),id))

 

Regards,

Prashant Sangle

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Vegar
MVP
MVP

What are you trying to archive? The two tables are not associated with each other.  You will always get 10 as output.

Count(id) will give you the same output in the example you posted.

sidhiq91
Specialist II
Specialist II

@kklue  Please elaborate on your issue.

kklue
Contributor II
Contributor II
Author

I want count(distinct id) according m1 and m2.

just like:

pick(seg_id,
count(distinct
aggr(
if(rank(m1)<=2 and rank(m2)<=2,id)
,id)
)
,
count(distinct
aggr(
if(rank(m1)<=4 and rank(m2)<=4,id)
,id)
)
,
count(distinct
aggr(
if(rank(m1)<=6 and rank(m2)<=6,id)
,id)
)
,
count(distinct
aggr(
if(rank(m1)<=8 and rank(m2)<=8,id)
,id)
)
,
count(distinct
aggr(
if(rank(m1)<=10 and rank(m2)<=10,id)
,id)
)
)

 

kklue
Contributor II
Contributor II
Author

but the expression above do not work as desire, only top2 has value:

kklue_0-1701323624240.png