Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Can any one please help me in understanding this logic ......
Sub_Prod:
LOAD ID,
if(SubStringCount(Product ,Sub_Product)>0,Sub_Product) as Sub_Prod
Resident Temp
where SubStringCount(Product ,Sub_Product)>0;
Thanks in Advance
The if() is redundant since the data is already filtered for the same criteria
SubStringCount(Product ,Sub_Product) This returns the number of occurences Sub_Product exists in Products
from qlik help
Example | Result |
---|---|
SubStringCount ( 'abcdefgcdxyz', 'cd' ) | Returns '2' |
SubStringCount ( 'abcdefgcdxyz', 'dc' ) | Returns '0' |
You can just do
Sub_Prod:
LOAD ID,
Sub_Product
Resident Temp
where SubStringCount(Product ,Sub_Product)>0; << because data is already filtered for same condition