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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
ricenoodles
Contributor
Contributor

Calculated expression in a table

Hello all,

I have an issue with "filtering" my market dimension with trim.

This is the current code that works, it is an expression in a table:

sum(if(ANNO_TBL=Anno_Exp and DATA<=Mese_Pari_Data AND TRIM(MARKET_2)='660' ,$(vQtFatturato)))

ricenoodles_0-1695215131435.png

My market dimension has all the markets that my company sells to. Let's say that i need to see just 2 or 3 markets, not 1 or all of them, but every time I try adding another market, it doesn't work. What is the correct way to write this? I am not familiar with this and so far I have only worked with code written by other people.

I've tried:

A.  sum(if(ANNO_TBL=Anno_Exp and DATA<=Mese_Pari_Data AND TRIM(MARKET_2)='660' AND TRIM(MARKET_2)='36' ,$(vQtFatturato)))

B.  sum(if(ANNO_TBL=Anno_Exp and DATA<=Mese_Pari_Data AND TRIM(MARKET_2)='660' OR TRIM(MARKET_2)='36' ,$(vQtFatturato)))

Basically I need to show to every seller, only their markets ex. Bob sells to the UK, Brazil and Norway, so he sees a table of only his markets. 

Thanks is advance.

 

Labels (3)
1 Reply
Cascader
Creator
Creator

try:

 sum(if(ANNO_TBL=Anno_Exp and DATA<=Mese_Pari_Data AND Match(TRIM(MARKET_2)='660' ,'36') ,$(vQtFatturato)))