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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Bode-IT
Contributor
Contributor

CONCAT + IF

Hi,

I want to do a ranking on order number and concatenate it to the name.

=Concat({<name={"=Rank(count(distinct(order)))=1"}>}name,', ')

This works fine. But I want to add an IF only for the current year. I tried different code but it did not work.
Could someone help me please? I tried both code but got no result returned.
=Concat({<name={"=If(Year(orderdate) = year(now()),Rank(count(distinct(order))=1))"}>}name,', ')

=If(Year(orderdate) = year(now()),Concat({<name={"=Rank(count(distinct(order)))=1"}>}name,', '),)

 

Thank you!

1 Solution

Accepted Solutions
stevejoyce
Specialist II
Specialist II

Try this using set analysis instead of if-statement

 

=Concat(Distinct {<name={"=rank(count(distinct {<orderdate={'=Year(orderdate)=Year(today())'}>} order))=1"}>}name,', ')

View solution in original post

2 Replies
stevejoyce
Specialist II
Specialist II

Try this using set analysis instead of if-statement

 

=Concat(Distinct {<name={"=rank(count(distinct {<orderdate={'=Year(orderdate)=Year(today())'}>} order))=1"}>}name,', ')

Bode-IT
Contributor
Contributor
Author

Thank you! Excellent!