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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
jduenyas
Specialist
Specialist

Not working

Hi all.

Can anyone see what is wrong with this Set Analysis? I am trying to get Sales of Last year's, in this case  July 1st - July 26th  but am getting unexplained value

SUM({<YR=, MO=, DA=,  QTR=, MonthYear=, TranDate={">=$(=Date(MonthStart(today(),-12))) <=DATE(AddMonths(Today(),-12))"}>}OrderValue)

TranDate is M/D/YYYY (7/26/2016)

My calendar is selecting Year = 2016

Thanks

Labels (1)
7 Replies
vinieme12
Champion III
Champion III

SUM({<YR=, MO=, DA=,  QTR=, MonthYear=, TranDate={">=$(=Date(MonthStart(today(),-12)))

<=$(=DATE(AddMonths(Today(),-12)))"}>}OrderValue)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
trdandamudi
Master II
Master II

Give a try with below expression:


SUM({<YR=, MO=, DA=,  QTR=, MonthYear=, TranDate={"$(= '>=' &Date(MonthStart(today(),-12)))  & '<=' &DATE(AddMonths(Today(),-12))"}>} OrderValue)

jduenyas
Specialist
Specialist
Author

I thought so too. But when using the <=$(=DATE(AddMonths(Today(),-12)))"}>} portion the return value is $0.00

And that is incorrect

vinieme12
Champion III
Champion III

ok and this

SUM({<YR=, MO=, DA=,  QTR=, MonthYear=,

          $(=NUM([TranDate])) ={">=$(=NUM(MonthStart(today(),-12)))

<=$(=NUM(AddMonths(Today(),-12)))"}>}OrderValue)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
jduenyas
Specialist
Specialist
Author

Same result as my original expression.  ... unexplained value...

jduenyas
Specialist
Specialist
Author

I am trying to put a sample together.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

As a test, you can put the two $-sign expansions in a text box to see what they produce and whether this set analysis spec is able to select records. Like

='>=$(=Date(MonthStart(today(),-12)))' & chr(10) &

'<=$(=Date(AddMonths(Today(),-12)))'

Best,

Peter

[Edit] I used Vineeth's expression because I think the original one produces an invalid set modifier