Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
nazaninslp
Contributor III
Contributor III

how write Calculated dimension using if,rank and concat

Dears

I wrote following calculated dimension which is show my top 10 selling titles based on revenue for current year.

Dimension: =if(Aggr(rank(sum({<Year={"$(=Max(Year))"}>}Revenue)),SellingTitle)<=10,SellingTitle)

now I want to concat my selling title with Content Title  in this code

Can you please help me to where I should  put the CONCAT in this dimension code?

Fields: SellingTitle, ContentTitle

 

 

 

Labels (3)
1 Solution

Accepted Solutions
y_grynechko
Creator III
Creator III

Hey,

in the dimension itself you can use '&' symbol to put together two dimensions. 

=if(Aggr(rank(sum({<Year={"$(=Max(Year))"}>}Revenue)),SellingTitle)<=10,SellingTitle & ContentTitle)

you can add ' - ' to make it look better:

 =if(Aggr(rank(sum({<Year={"$(=Max(Year))"}>}Revenue)),SellingTitle)<=10,SellingTitle& ' - ' &ContentTitle)

View solution in original post

2 Replies
y_grynechko
Creator III
Creator III

Hey,

in the dimension itself you can use '&' symbol to put together two dimensions. 

=if(Aggr(rank(sum({<Year={"$(=Max(Year))"}>}Revenue)),SellingTitle)<=10,SellingTitle & ContentTitle)

you can add ' - ' to make it look better:

 =if(Aggr(rank(sum({<Year={"$(=Max(Year))"}>}Revenue)),SellingTitle)<=10,SellingTitle& ' - ' &ContentTitle)

nazaninslp
Contributor III
Contributor III
Author

Dear   y_grynechko

Thank you so much, it is working fine.

but I faced with another problem!

now my Content Title is not sorted, because I need show top 10 content title and selling title based on revenue,

every selling title may have multiple content title

can you help me how fix that?

 =if(Aggr(rank(sum({<Year={"$(=Max(Year))"}>}Revenue)),SellingTitle)<=10,SellingTitle& ' - ' &ContentTitle)