Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
maoyingqlik
Contributor
Contributor

sales qty by select special promotion terms in each months

Hi, 

I am a  new user in qlik sense.

when I separate set this expression, it doesn't have any problem 

Sum({$<[TXDATE.autoCalendar.MonthsAgo]={"1"}>}PROMOSALESQTY)

I set the below wildmatch on selection box, that's also no problem

=if(wildmatch(XF_REMARK,'*crazysales*'),'crazysales,'general promotion')

 

but how can I combine them, if I don't want to use selection box?

I want directly the "PROMOSALESQTY" in each month (past 12 months) only show the crazy sales qty?

Thanks a lot!

 

 

1 Solution

Accepted Solutions
dplr-rn
Partner - Master III
Partner - Master III

No 100% clear on your requirement but you could add this to your sum expression to show only crazysales
XF_REMARK={"*crazysales*"}
e.g.
Sum({$<XF_REMARK={"*crazysales*"},[TXDATE.autoCalendar.MonthsAgo]={"1"}>}PROMOSALESQTY)

View solution in original post

6 Replies
dplr-rn
Partner - Master III
Partner - Master III

No 100% clear on your requirement but you could add this to your sum expression to show only crazysales
XF_REMARK={"*crazysales*"}
e.g.
Sum({$<XF_REMARK={"*crazysales*"},[TXDATE.autoCalendar.MonthsAgo]={"1"}>}PROMOSALESQTY)
maoyingqlik
Contributor
Contributor
Author

It's works now. Thanks a lot.

I try yours similar before but I write XF_REMARK={'*crazysales*'} that didn't work.

Just wonder, in what situation by using " & ' ?

 

dplr-rn
Partner - Master III
Partner - Master III

single quotes are for literal string (i.e. exact matches) not searches.
in this case you should use " even though the single quotes work.
if i recall correctly its a bug (even though it works).

Not 100% on the latest status of this

see below from @hic 
https://community.qlik.com/t5/Qlik-Design-Blog/Quotes-in-Set-Analysis/ba-p/1471824#comments

dplr-rn
Partner - Master III
Partner - Master III

mark as answered and close thread if it helped
hic
Former Employee
Former Employee

The bug was fixed in the November 2018 release.

So, now the behaviour is the following:
XF_REMARK={"*crazysales*"} is a case insensitive search using a wildcard.
XF_REMARK={'*crazysales*'} is a case sensitive match with a string that is 12 characters long, and starts and ends with a '*' (char(42)).

HIC

dplr-rn
Partner - Master III
Partner - Master III

Thanks Henric for the update