Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
nazaninslp
New 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

 

 

 

1 Solution

Accepted Solutions
Highlighted
y_grynechko
Contributor III

Re: how write Calculated dimension using if,rank and concat

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
Highlighted
y_grynechko
Contributor III

Re: how write Calculated dimension using if,rank and concat

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

Highlighted
nazaninslp
New Contributor III

Re: how write Calculated dimension using if,rank and concat

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)