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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
tamilarasu
Champion
Champion

SET Analysis with left function

Hello All,

I am trying to change an expression from If condition to Set analysis. I have tried the below expression and it seems not working.

Only({$<Left(%HLINK,2)={'*'}-{'00'}>}MA_ENHANCED.MNR)

Could any one guide me.

scriptina.regular.png

1 Solution

Accepted Solutions
jagan
Partner - Champion III
Partner - Champion III

Hi,

Try this

Only({<%HLINK-={'00*'}, PR.KO={'900'}, PR.KS={'ZF'}> + <%HLINK={'00*'}, PR.KO={'901'}, PR.KS={'ZF'}>} MA_ENHANCED.MNR)

View solution in original post

5 Replies
Not applicable

Hi Nagraj,

Here Left(%HLINK,2) will give '%H' as result.

Is there any field having name as '%H'?

Can you please explain your requirement clearly?

Thanks

Harsha Nandan

tamilarasu
Champion
Champion
Author

Hi Nandan,

%Hlink is a field. Below is my actual expression and I want to modify the expression with set analysis.

If((Left(%HLINK,2)<>'00'  and PR.KO='900' and PR.KS='ZF') or (Left(%HLINK,2)='00'  and PR.KO='901' and PR.KS='ZF') ,

MA_ENHANCED.MNR)


But it seems left function not working in set analysis.

danieloberbilli
Specialist II
Specialist II

Can you post your if-function?

Maybe you should consider to create a new field in the script like eg.

...

left(%HLINK,2) as %HLINK_2left,

...

I guess it should be sth like:

Only({<%HLINK_2left={“*”} – {'00'}>} MA_ENHANCED.MNR)


it must be double quote for the star-symbol as you are "searching" and not looking up a 'value'


jagan
Partner - Champion III
Partner - Champion III

Hi,

Try this

Only({<%HLINK-={'00*'}, PR.KO={'900'}, PR.KS={'ZF'}> + <%HLINK={'00*'}, PR.KO={'901'}, PR.KS={'ZF'}>} MA_ENHANCED.MNR)

tamilarasu
Champion
Champion
Author

Jagan,

Thank you.

Daniel,

I don't want to touch the data model as it was created already. Thanks for your help.