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

trim text in legend using left function

Hi guys,

I have a field that is made up of joining 2 other field to create a unique key that a map for cycle time is calcuated on , See below :

Field 1Field 2Unique
GroceriesBreadGroceriesBread
GroceriesGlovesGroceriesGloves
ClothingShoesClothingShoes
GroceriesMilkGroceriesMilk
ClothingGlovesClothingGloves
ClothingHatsClothingHats

This is the map so even though field 2 has Gloves in it twice we can determine diff cycle times based on field 1.

UniqueTime to   complete
GroceriesBread5
GroceriesGloves10
ClothingShoes10
GroceriesMilk5
ClothingGloves15
ClothingHats10

Anyhow, now we have a chart based on Unique field -- But in the legend it is displayed as the unique title we would like to trim field 1 from this in display of chart

Using Excel we would do the following --- Is there an equivalent in Qlikview

=IF(LEFT([Field1],1)="G",TRIM(MID([Field1],10,20)),IF(LEFT([Field1],1)="C",TRIM(MID([Field1],9,20))))

Thanks


A

1 Solution

Accepted Solutions
jagan
Partner - Champion III
Partner - Champion III

hi,

Try using this Calculated Dimension, I think it works.

Regards,

Jagan.

View solution in original post

6 Replies
Anonymous
Not applicable
Author

What result are you looking for?

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     You can use the same thing as below

     =IF(LEFT([Field1],1)="G",Right([Field1],len([Field1])-10),IF(LEFT([Field1],1)="C",Right([Field1],len([Field1])-9))

Hope its your need

Celambarasan

jagan
Partner - Champion III
Partner - Champion III

Hi,

The below expression will directly Trim Field1 in Unqiue Field

=Replace(Unique, Field1, '')

Instead why can't you directly use Field2 as dimension.

Regards,

Jagan.

Not applicable
Author

Hi Guys

I wish to get the result :

Bread

Gloves

Shoes

Milk

Gloves

Hat

Jagan do I use the above as a calculate Expression ?

Thanks

jagan
Partner - Champion III
Partner - Champion III

hi,

Try using this Calculated Dimension, I think it works.

Regards,

Jagan.

SunilChauhan
Champion II
Champion II

spece should be like below

=replace(Unique,[Field 1],' ')

use in dimension

hope this helps

Sunil Chauhan