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

Result in required format

Input values are in below scenario,

Field1: P/P/R/R

Field2: 100/100/200/200

Required output in below format,

Field1: P/R

Field2:100/200

Please suggest how to trim those values to get above output format

6 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Do you mean that your data is in below format.

Field1,Field2

P,100

P,100

R,200

R,200

If yes then try this.

Load Distinct Field1,Field2

From xyz;

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

No, I have to trim this values at UI/presentation level and display as below format

field1: P/R

field2: 100/200

Not like (P/P/R/R, 100/100/200/200)

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Tell me one thing, is your field has only 1 record in this case? Please provide some sample data for more clarification.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

yes, field1 contains 1 value i.e P/P/R/R and field2 contains 1 value i.e 100/100/200/200

Now , we have to display o/p as P/R for field1 & 100/200 for field2.

settu_periasamy
Master III
Master III

Hi,

Try this

=SubField('P/P/R/R','/',1)&'/'&SubField('P/P/R/R','/',3)

=SubField('100/100/200/200','/',1)&'/'&SubField('100/100/200/200','/',3)

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Have a look at the attached example.

This will work for only 1 record in table, but it can work for any numbers of sub value (4 in your example)

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!