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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
hopkinsc
Partner - Specialist III
Partner - Specialist III

Changing the way data is displayed within a field

Hi,

I have a field called 'Narrative', Within this field are loads of descriptions (See attached spreadsheet)

What i want to do is group them together and rename them.

e.g.

All descriptions starting with 'Goods ' to be renamed 'Goods Received'

All descriptions starting with Stock' to be renamed 'Stock Check'

I know how to do this within the application :

=IF(UPPER(Narrative) like 'Stock*','Stock Checking' ,Narrative)

but i want to do it in the load script. Can anyone tell me if it can be done please?

1 Solution

Accepted Solutions
kaushalview
Partner - Creator II
Partner - Creator II

Hi,Hopkinsc

you could slove your Problem as given below .

if(wildmatch(Narrative,'Go*')>0,'Goods Received',

if(wildmatch(Narrative,'St*')>0,'Stock Check')) as Narrative

ok.

View solution in original post

6 Replies
Not applicable

Hi,

you could do something as under:

if ( mid ( Narrative, 1 , 5 ) = 'Goods' , 'Goods Received' , Narrative ) as ModifiedNarrative

Similarly multiple if statements could be added within the script

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Thanks Umang, can you tell me hwta the (Narrative, 1,5) means in the statement please?

Not applicable

The function used is Mid - which searches the text "Narrative" from the first alphabet & looks for takes the first five alphabets to match it with "Goods"

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Ok, thanks. That works great for the one example (Goods).

i'm trying to add more though, how would i include multiple descriptions.

E.g.

Goods = Goods Receiving

Stock = Stock check

Ordereing = Stock Adj (Ordering)

etc

Thanks

kaushalview
Partner - Creator II
Partner - Creator II

Hi,Hopkinsc

you could slove your Problem as given below .

if(wildmatch(Narrative,'Go*')>0,'Goods Received',

if(wildmatch(Narrative,'St*')>0,'Stock Check')) as Narrative

ok.

Not applicable

You would need to build the formula, I am writing down as example

if ( mid ( Narrative, 1 , 5 ) = 'Goods' , 'GoodsReceiving' ,
if ( mid ( Narrative, 1 , 5 ) = 'Stock' , 'Stockcheck',
if ( mid ( Narrative, 1 , 8 ) = 'Ordering' , 'StockAdj(Ordering)' , Reason ))) as ModifiedNarrative