Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
adiarnon
Creator III
Creator III

set analysis problem

whats wrong in this expression:

Sum({<Month={'<=month(today())'}>}Target_Product)

i want the sum of Target_Product till the end of the month

tnx.

1 Solution

Accepted Solutions
sunilkumarqv
Specialist II
Specialist II

Try this sorry for previous one

=Sum({<Month={"=(Month>(Month(today())))"}>}Target_Product)

View solution in original post

12 Replies
tresesco
MVP
MVP

Try like:

Sum({<Month={"<=$(=month(today()))"}>}Target_Product)

adiarnon
Creator III
Creator III
Author

tnx

but its not working... =/

tresesco
MVP
MVP

I guess the month data format could be the issue. Could you post your sample app?

adiarnon
Creator III
Creator III
Author

this expression works:

=Sum({<Month={"=(month(today()))"}>}Target_Product)

gives only the target of the current month

Not applicable

Adi,

When using month() function, it will return Feb, Oct according to your parameters. = is OK, <= is not.

You should do num(month(today()))

When you perform date comparison, you should use numeric.

Fabrice


PrashantSangle

Hi,

Use proper function name inside ""

Like use =Month(Today())

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
tresesco
MVP
MVP

This has given a new finding:

Fabrice Aunez , comparison works (because with Month() the output is actually a dual), but with a different style:

=Sum({<Month={"=Month>Month(Today())"}>}Amt)    // Set analysis example

=Sum(If(Month>Month(today()),Amt))              // If

So, adi arnon, this : Sum({<Month={"=Month<=Month(Today())"}>}Target_Product)        , would work for you.

PFA

Not applicable

Tresesco,

I partially agree.

These two syntaxes work:

sum ({<Month ={"<= $(=num(month(today())))"} >} Amount)

sum({<Month ={"=Month<Month(today()) "} >} Amount)

This syntax does not work (I do not get any result): The only difference with the first syntax is the num() function that is not used.

sum({<Month ={"<= $(=month(today()))"} >} Amount)

Month is dual: it has been constructed using the Month() function.

In set analysis, I think it is better to use numeric for date comparisons. But (you are right) that is not the single way.

Fabrice

adiarnon
Creator III
Creator III
Author

i tried this:

=Sum({<Month={"<=$(month(today()))"}>}Target_Product)

its giving me the target of the whole year. nit just till this month

help please