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: 
guldana0307
Contributor
Contributor

Subfield a Distinct values in Row

I have a field with different values. I want to make subfield  also using crosstable, so that the subfield result  is in one column. My script looks like this

Partners_TMP:
CrossTable(БИН,Country_ID,1)
LOAD DISTINCT
BIN,
trim(SubField( STRANI_UCHASTNICI, ',')) as STRANI_UCHASTNICI

FROM [lib://SBR (statdata_g.abzhanova) (statdata_aru.mussina)/JPBIN.qvd]
(qvd)
where not isNull (BIN);

NoConcatenate
Partners:
load Distinct
BIN as БИН,
Country_ID
Resident [Partners_TMP];
drop Table [Partners_TMP]; 

 

My data looks like this:

guldana0307_0-1697092257073.png

The problem is when i made subfield it separated each value in the row, but i need to make subfied inly for distinct value. Help me to solve this problem. 

Labels (1)
8 Replies
vincent_ardiet_
Specialist
Specialist

Could you provide an example of what you want to obtain?

guldana0307
Contributor
Contributor
Author

 

A liltle part of my data

guldana0307_1-1697105011278.png

 

vincent_ardiet_
Specialist
Specialist

This is your source or the result you want? Could you illustrate what you have in input and what you want as output?

guldana0307
Contributor
Contributor
Author

This is not a result. this is a data i need to transform. 

Actually i need to transform the second field "STRANI_UCHASTNICI". 

This is the input data:

guldana0307_0-1697106636738.png

The output should be like this. I need extract values from a row, only DISTINCT value. 

guldana0307_1-1697106781437.png

 

 

 

Or
MVP
MVP

Typically this is easiest to handle with a preceding load:

Load distinct *;

LOAD
BIN,
trim(SubField( STRANI_UCHASTNICI, ',')) as STRANI_UCHASTNICI

FROM [lib://SBR (statdata_g.abzhanova) (statdata_aru.mussina)/JPBIN.qvd]
(qvd)
where not isNull (BIN);

guldana0307
Contributor
Contributor
Author

Thank you, but i already used this one also. It doesn't help. 

vincent_ardiet_
Specialist
Specialist

This is weird, I don't see why your solution would not work.
Could you try to stop before you use the concatenation and have a look to the result of the first statement only? Or to store the result? Maybe having a look to this result will help to understand why this is not working as expected.

guldana0307
Contributor
Contributor
Author

Thank you very much for your answer, i already have found the solution.