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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

expression filter causing issue

Hi, I have to put the following condition in my Tmap ie

when name='ABC' and year=2010 to 2017, then only give o/p. name is coming from Datasource1 and year from Datasource2

 

so in Tmap, I created this expression filter and it doesn't work.

(Datasource1.name=="ABC" && (Datasource2.year >=2010 && Datasource2.year <=2017))

 

What is wrong with it..? Thanks in advance for help!

Labels (2)
7 Replies
mks02
Creator
Creator


I took 2 excel files and join with tMap using your filter. Its working perfectly there.
File 1 Schema: ID (int), NAME (string)
File 2 Schema: ID (int), Year (int)
 
File1.NAME.equals("ABC") &&  (File2.YEAR >=2010 && File2.YEAR <=2018)

--> '==' operator compares two object references to see whether they refer to the same instance.
--> equals() method compares the characters inside a String object i.e. compare the data.


Hope it helps.

Anonymous
Not applicable
Author

 

0683p000009Lwjs.pngThanks, I tried using the same logic. and it throws some java error.


3.png
mks02
Creator
Creator

No need to use the logic in VAR area. You need to put the filter in tMap Output table area.
Please see the attachment for more details.

Let me know if it helps.


TLND_tmap_exprFilter.PNG
Anonymous
Not applicable
Author

Hi,

 

I don't put the expression in the VAR area. I put it in expression builder area only. Somehow it threw error. Is this expression working for u..?

mks02
Creator
Creator

Yes, its working in my case.
After applying this code APPLY OK, just run the job. It will give desired result.

There is possibility that your system has more than 1 java versions, so you need to uninstall them, then reinstall which one you needed.

Anonymous
Not applicable
Author

Hi Mk02,

 

Yes, I do have mutiple java versions. see below. which one should I keep..?

 

0683p000009Lwcs.png

manodwhb
Champion II
Champion II

I Suggest you to unistall Java 10