Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
mramitbhandari17
Contributor III
Contributor III

Fetch multiple IP Address information from string field and also get latest IP address

Hi,

I am trying to fetch multiple ip address information from string field. Below is the example

String column

'ABC user fetch values from 7.2.1 below and 7.1.1 version and below, 7.2 all versions, 7.0 all versions, 6.4 all versions'

'fetch user ip addresses 7.4.2 and below, 7.2 all versions, 7.0 all versions, 2.0 all versions may allow a privileged'

how to get only ip address in one cell with latest ip address

7.2.1, 7.1.1

7.4.2

Labels (4)
3 Replies
Taoufiq_Zarra

@mramitbhandari17  Maybe something like this?

 

 

Table1:
LOAD *,
SubField(StringColumn, ',', IterNo()) AS Version
WHILE IterNo() <= SubStringCount(StringColumn, ',') + 1;
LOAD * INLINE [
StringColumn
'ABC user fetch values from 7.2.1 below and 7.1.1 version and below, 7.2 all versions, 7.0 all versions, 6.4 all versions'
'fetch user ip addresses 7.4.2 and below, 7.2 all versions, 7.0 all versions, 2.0 all versions may allow a privileged'
];

 

TableWithIPs:
LOAD *,
If(
WildMatch(Version, '*.*.*'),
KeepChar(Version, '0123456789. '),
Null()
) AS ExtractedIP
RESIDENT Table1;

 

NoNullIPs:
noconcatenate
LOAD
StringColumn,
ExtractedIP
RESIDENT TableWithIPs
WHERE NOT IsNull(ExtractedIP);
DROP TABLE Table1,TableWithIPs;

 

OutputTable:
noconcatenate
LOAD
StringColumn,
ExtractedIP
RESIDENT NoNullIPs;

DROP TABLE NoNullIPs;

 

output  :

 

Taoufiq_Zarra_0-1729521261556.png

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
mramitbhandari17
Contributor III
Contributor III
Author

Something like that however string column coming from source feed and need to do under Qlik table with help of function in table format.

 

mramitbhandari17
Contributor III
Contributor III
Author

This is not resolving my issue.