6 Replies Latest reply: Feb 23, 2012 5:15 AM by Sunil Chauhan

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 1 Field 2 Unique Groceries Bread GroceriesBread Groceries Gloves GroceriesGloves Clothing Shoes ClothingShoes Groceries Milk GroceriesMilk Clothing Gloves ClothingGloves Clothing Hats ClothingHats

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

 Unique Time to   complete GroceriesBread 5 GroceriesGloves 10 ClothingShoes 10 GroceriesMilk 5 ClothingGloves 15 ClothingHats 10

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

• trim text in legend using left function

What result are you looking for?

• trim text in legend using left function

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))

Celambarasan

• trim text in legend using left function

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.

• trim text in legend using left function

Hi Guys

I wish to get the result :

Gloves

Shoes

Milk

Gloves

Hat

Jagan do I use the above as a calculate Expression ?

Thanks

• trim text in legend using left function

hi,

Try using this Calculated Dimension, I think it works.

Regards,

Jagan.

• trim text in legend using left function

spece should be like below

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

use in dimension

hope this helps