Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

andreyfcdk91
New Contributor III

Separating each symbol in string

Colleagues, good day!

I have one field, which contain information about delivery days.

For example, if delivery days are Monday, Tuesday - value is MT.

Friday, Saturday- FS.

How i can convert such symbol combination into days concat.

Maybe, it's possible by concat function, which can read string per symbol?

Necessary result:

 

DelDaysResult by exp
FFriday
TTuesdat
MWMonday, Wednesday
SuSunday
MTWThMonday, Tuesday, Wednesday, Thursday
1 Solution

Accepted Solutions

Re: Separating each symbol in string

You can use MapSubString in that case. Try this,

Map:
Mapping LOAD * INLINE [
Short, Full
M, ", Monday"
T, ", Tuesday"
W, ", Wednesday"
Th, ", Thursday"
F, ", Friday"
S, ", Saturday"
Su, ", Sunday"
]
;

Tab:
LOAD DelDays, Mid(MapSubString('Map',DelDays),3) as Result
INLINE [
DelDays
F
T
MW
Su
MTWTh
]
;

Untitled.png

10 Replies
amit_saini
Honored Contributor III

Re: Separating each symbol in string

Hi,

Try:

Load * Inline [

DelDays ,    Result

F,    Friday

T,    Tuesdat

MW    ,"Monday, Wednesday"

Su    ,Sunday

MTWTh,    "Monday, Tuesday, Wednesday, Thursday"

];

Thanks,

AS

Re: Separating each symbol in string

Like This,

Make sure, You have List box you can write this expression in Expression Tab.

Hope Helpful...

=If(DelDays = 'F','Friday',

     If(DelDays = 'T','Thursday',

          If(DelDays = 'MW','Monday, Wednesday',

               If(DelDays = 'SU','Sunday',

                    If(DelDays = 'MTWT','Monday, Tuesday, Wednesday, Thursday',)

                 )

              )

          )

        )

Life is so rich, and we need to respect to the life !!!
Not applicable

Re: Separating each symbol in string

Use a if() to create the field is possible to do the outcome FYR:Creating a new field with IF statement  Hope It helps!

Re: Separating each symbol in string

see this

Directory;

LOAD *,

    Pick(match(DelDays,'F','MTWT','MW','Su','T'),'Friday','Monday, Tuesday, Wednesday, Thursday','Monday, Wednesday','Sunday','Tuesday') as Days;

LOAD DelDays

FROM

Test.xlsx

(ooxml, embedded labels, table is Лист1);

Capture.JPG

andreyfcdk91
New Contributor III

Re: Separating each symbol in string

Thanks.

But i mean some automatic checking by these symbol combination.

I have more than 60 such combination and i need write condition for each of them (count of these conditions can grow)

Re: Separating each symbol in string

I think mine answer is not helpful

Re: Separating each symbol in string

Nai yaar... esa nai hai... bahut helpful hai

Re: Separating each symbol in string

Kushal,

Not like that, What ever poster expecting we are giving the solutions. He didn't release any thing about what he is looking.

Meantime, That is not a problem - Whoever poster he just release BTA. If he tell something hints then we can try.

- Anil Chowdary

Life is so rich, and we need to respect to the life !!!

Re: Separating each symbol in string

You can use MapSubString in that case. Try this,

Map:
Mapping LOAD * INLINE [
Short, Full
M, ", Monday"
T, ", Tuesday"
W, ", Wednesday"
Th, ", Thursday"
F, ", Friday"
S, ", Saturday"
Su, ", Sunday"
]
;

Tab:
LOAD DelDays, Mid(MapSubString('Map',DelDays),3) as Result
INLINE [
DelDays
F
T
MW
Su
MTWTh
]
;

Untitled.png

Community Browser