Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Jennyy
Contributor
Contributor

Solved: Error in set modifier expression

Hi, 

 

Can someone help me with the 'error in set modifier expression' in this code?: 

I want to calculate the sales of last month

 
Sum({< Year, [Quarter], [Month], week, Day, 
    [Date] = {"$(= '>=' & MonthStart(AddMonths(Max([Date]),-1)) & '<=' & AddMonths(Max([Date]),-1))"},
         $<[Product group]={'Fruit'}>
        -1<[Article name]={'apple'}
                       >}
                                   sales)
Labels (1)
5 Replies
theoat
Partner - Creator III
Partner - Creator III

Hello,

You can try something like this :

Sum({
< Year,
[Quater],
[Month],
week,
Day,
[Date] = {">=$(=MonthStart(AddMonths(Max([Date]),-1)))<=$(=MonthEnd(AddMonths(Max([Date]),-1)))"},
[Product group] = {'Fruit'},
[Article name] -= {'apple'}
>}
sales)


Enjoy your Qlik.

Kind regards,
Théo ATRAGIE.

 

Jennyy
Contributor
Contributor
Author

Thanks Théo, but it still has the same error. Is there another solution? Best, Jen

theoat
Partner - Creator III
Partner - Creator III

Can you share me an set of data to make tests?

Jennyy
Contributor
Contributor
Author

Sorry I can't, because of privacy issues...

marcus_sommer

Just check it step by step and commenting all conditions unless one and the next and the next ...

Beside this the suggestion from Theo should work from a syntax point of view (if all field-names were correct specified) because it's a single set statement with n conditions while your approach was n set statements which weren't correct opened/closed and linked.