Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
sunny_talwar

Range Concat or Something Similar

Hi Team -

Is there a way to perform Range Concat in a chart?

Sample:

DateDim
01/01/2016A
01/02/2016B
01/03/2016C
01/04/2016D
01/05/2016E

Output:

DateCumulative
01/01/2016A
01/02/2016A, B
01/03/2016A, B, C
01/04/2016A, B, C, D
01/05/2016A, B, C, D, E

Thanks,

Sunny

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

This works.

if(rowno()=1,Letter,above(Cumulative) & if(not index(above(Cumulative),Letter),',' & Letter))

Edit: Sorry, I even hit refresh, but still didn't see your reply before I posted, Digvijay Singh.

View solution in original post

9 Replies
swuehl
MVP
MVP

You could try a straight table with dimension Date and as expression

=If(Rowno()>1,Above("Cumulative") & ', ') & Dim

Cumulative being the expression label

sunny_talwar
Author

Stefan what about doing a distinct concatenation?

Sample:

DateDim
01/01/2016A
01/02/2016B
01/03/2016B
01/04/2016D
01/05/2016B

Output:

DateCumulative
01/01/2016A
01/02/2016A, B
01/03/2016A, B
01/04/2016A, B, D
01/05/2016A, B, D
Digvijay_Singh

This worked on sample for me -

If(RowNo()>1,Above(Cumulative) & if(not wildmatch(Above(Cumulative),'*'&Dim&'*'),',' & Dim),Dim)

johnw
Champion III
Champion III

This works.

if(rowno()=1,Letter,above(Cumulative) & if(not index(above(Cumulative),Letter),',' & Letter))

Edit: Sorry, I even hit refresh, but still didn't see your reply before I posted, Digvijay Singh.

Digvijay_Singh

I am your big fan You made it simpler, Thanks

sunny_talwar
Author

Hahahaha thanks for agreeing Digvijay‌, you answered first, but John's answer is definitely little more simpler. I wish I had the option to reward two correct answers . But I just know a way to get you the points

rubenmarin

Hi Sunny, just in case some string are substrings of others, I will enclose all values between some delimiter characters in a hidden column and remove them in the visible column.

I've added a file in the inline table to check the behaviour:

01/12/2015,AA

MarcoWedel

Hi Sunny,

not quite a new thread, but I wanted to contribute another solution nevertheless:

QlikCommunity_Thread_209632_Pic1.JPG

expressions:

Left(Concat(TOTAL Dim,',',Date),Index(Concat(TOTAL Dim,',',Date)&',',',',RowNo())-1)


Left(Concat(TOTAL Dim,',',Date),RangeSum(Above(Len(Dim)+1,0,RowNo()))-1)


using some rearranged data to test for correct order:

QlikCommunity_Thread_209632_Pic2.JPG

Marco

sunny_talwar
Author

marcowedel‌ your responses are always welcomed