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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Displaying Column Names as Text Instead of Numbers

So there could be an easy way to do this, I assumed the text() function could handle it, but when I looked it up on help, it said that the result would come out as " - ".

Anyway, I have a table with 10 rows and say 50 columns. I'm trying to group the columns in 4 categories by size and graph those 4 categories. For example, Each column is a year and I would like to group years <10, 11-15, 16-24, and 24+. Then graph the resulting 4 categories as a stacked bar graph for each row (which also happen to be years).

Here is a picture of my data and dimension formula ungrouped:

error loading image

I'm using the left() function because the maturityDt field is in yyyymmdd format. So as you can see I'd like to group these years in four categories; since it will make it look cleaner than having about 50 years. Here is a screen shot of what I have grouped:

error loading image

So as you can see, the 1 column is anything that's 25 years + and the 0 column is everything else. I will probably do an imbedded if() statement that will take care of the 0 column but as far as the 1 column: I would like to know how to display that 1 as text and says ">25 Years" instead of 1, thanks.

1 Solution

Accepted Solutions
pover
Partner - Master
Partner - Master

Does a if((left(maturityDt,4)-Year)>=25,'>25 Years',0) work?

Regards.

View solution in original post

5 Replies
pover
Partner - Master
Partner - Master

Does a if((left(maturityDt,4)-Year)>=25,'>25 Years',0) work?

Regards.

Not applicable
Author

I actually tried using " instead of ' which was my mistake, thanks. Simple fix.

Not applicable
Author

Another question I had was what is the equivalent of the if(and()) statement in QV script? I want to condition a field to be between 16-24 years...

pover
Partner - Master
Partner - Master

The and() would be

if((left(maturityDt,4)-Year)<25 and (left(maturityDt,4)-Year)>=16 ,'>=16<25 Years',0)

Not applicable
Author

Thanks Karl