Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Soham
Contributor II
Contributor II

Matching string and returning field value in text object

I have two tables - 

eg - 

T1                                                               T2

T1F1                           T1F2            |          T2F1                                 T2F2 

abcd                           65                 |          xyz                                       10002
xyz                               100                |           efg                                        10029
lpq                              19               |          mno                                    10078

I want to show value of T2F2 for T2F1 = xyz . Ideally I need to get T1F1 with highest T1F2 value and show T2F2 for the same value in a text and image object. For simplicity let's hard code the value 'xyz'

 

I have tried 

=if(min([T2F1] like 'XYZ'),'Y','N')

     from a different post which returns Y but when I replace 'Y' with the field name nothing gets returned. 

=if(min([T2F1] like 'XYZ'),T2F2,'N')



The table T2F2 contains unique values for T2F1.

Would appreciate any help as I am a newbie to qliksense.

 

Thanks.        

 

Labels (1)
1 Solution

Accepted Solutions
martinpohl
Partner - Master
Partner - Master

Screen1.JPG

 

here is a screenshot, hope you can see

 

View solution in original post

7 Replies
martinpohl
Partner - Master
Partner - Master

I don't know what the reason is but see attached.

Regards

Soham
Contributor II
Contributor II
Author

I am sorry about this. I open the .qvw file but I don't see anything. Can you please guide me to what I should be looking for ?

martinpohl
Partner - Master
Partner - Master

Screen1.JPG

 

here is a screenshot, hope you can see

 
Taoufiq_Zarra

Honestly, I don't get it

but I think this will help you

first in the script :

T1:
LOAD T1F1 as Key,* INLINE [
    T1F1,T1F2
    abcd,65
    xyz,100
    lpq,19
];

T2:
LOAD T2F1 as Key,* INLINE [
    T2F1,T2F2
    xyz,10002
    efg,10029
    mno,10078
];

LOAD

     FirstSortedValue(T1F1,-(T1F2)) as MaxT1F_
Resident T1
;

LET vMaxT1F1 =peek('MaxT1F_');

 

and then in the text/image object :

=only({<T2F1={$(vMaxT1F1)}> } T2F2)
Regards,
Taoufiq ZARRA

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

(you can mark up to 3 "solutions") 😉
Soham
Contributor II
Contributor II
Author

Thank you for this. I do see it and it is working fine. But is there any reason as to why the if expression was not working ?

Taoufiq_Zarra

T2F1 is a string !

min(T2F1) ->minstring(T2F1)

but it's not good to use it like that also you must to aggregate ....

Regards,
Taoufiq ZARRA

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

(you can mark up to 3 "solutions") 😉
Soham
Contributor II
Contributor II
Author

Thank you.