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: 
Jennyy
Contributor II
Contributor II

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 - Specialist
Partner - Specialist

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 II
Contributor II
Author

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

theoat
Partner - Specialist
Partner - Specialist

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

Jennyy
Contributor II
Contributor II
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.