Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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
Luminary Alumni
Luminary Alumni

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
Luminary Alumni
Luminary Alumni

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
Luminary Alumni
Luminary Alumni

hi,

Try using this Calculated Dimension, I think it works.

Regards,

Jagan.

SunilChauhan
Champion
Champion

spece should be like below

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

use in dimension

hope this helps

Sunil Chauhan