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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Srinivas
Creator
Creator

remove prefix values in List Box

Hi,

I have one list box in that remove prefix values with dynamically. see blow example,

20-3214

20-8765

200-3217

2000-8775

30-1365

60-2348

PPSE+10-7654

PPSE+20-8765

in that list box prefix have some times have Two,Three and Four times. This is problem i can't able to remove those prefix values.

Please help on this..

Regards & Thanks

Munna

Labels (1)
19 Replies
ashfaq_haseeb
Champion III
Champion III

Hi,

Try below.

Load *,subfield(Value, '-' ,2) as NewValue;

load * inline

[

Value

20-3214

20-8765

200-3217

2000-8775

30-1365

60-2348

PPSE+10-7654

PPSE+20-8765

];

Regards

ASHFAQ

Not applicable

Hi,

Try the TextBetween() Function.

For example. TextBetween('PPSE+10-7654997','-','')

                    Result : 7654997.

Regards.

Srinivas
Creator
Creator
Author

Hi Sujeet,

As for ur logic removed before '-' values it's working fine, But here my question is some values have without '-' so in that situation not working properly could u please check.

20-32145

11745

289634

467912

20-8765

200-3217

2000-877587

30-136523

60-2348

PPSE+10-7654997

PPSE+20-876534567


Regards,

Munna

Srinivas
Creator
Creator
Author

Thanks Ashfaq,

As for ur logic removed before '-' values it's working fine, But here my question is some values have without '-' so in that situation not working properly this list box showed only '-' values not other,Could u please check.

20-32145

11745

289634

467912

20-8765

200-3217

2000-877587

30-136523

60-2348

PPSE+10-7654997

PPSE+20-876534567


Regards,

Munna

ashfaq_haseeb
Champion III
Champion III

Hi,

Post sample data.

and try to close thready once its answered your concern.

Regards

ASHFAQ

ashfaq_haseeb
Champion III
Champion III

Hi,

Try below code.

Load *,if(num(Value),Value,subfield(Value, '-' ,2)) as NewValue;

load * inline

[

Value

20-32145

11745

289634

467912

20-8765

200-3217

2000-877587

30-136523

60-2348

PPSE+10-7654997

PPSE+20-876534567

];

Regards

ASHFAQ

ashfaq_haseeb
Champion III
Champion III

Now close this thread by selecting appropriate answer.

Regards

ASHFAQ

Srinivas
Creator
Creator
Author

Hi Ashfaq,

See below sample data.

ID dimension contains 12 values & after applying subfield function then it's NewID  dimension contain 7 values only means here NewID dimension doesn't take without '-' values.But i need all 12 values in NewID dimension.

Load *,subfield(ID, '-' ,2) as NewID;

load * inline

[

ID

20-3214

278634

387634

987643

765247

20-8765

200-3217

2000-8775

30-1365

60-2348

PPSE+10-7654

PPSE+20-8765

];

Srinivas
Creator
Creator
Author

Thanks a lot Ashfaq, It's working fine.

ashfaq_haseeb
Champion III
Champion III

Hi did you try my code

Load *,if(num(Value),Value,subfield(Value, '-' ,2)) as NewValue;

load * inline

[

Value

20-32145

11745

289634

467912

20-8765

200-3217

2000-877587

30-136523

60-2348

PPSE+10-7654997

PPSE+20-876534567

];

Regards

ASHFAQ