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: 
sagar_vij99
Creator
Creator

Using Set Analysis with Text

Hi All,

I am trying to use below expression with set but somehow it is not working.

here i am trying to sum Headcount field value and i need to get the value for last month.

=sum({$<P_Month={"=Date(AddMonths(today(),-1),'MMMM')"}>}Headcount)

any help will be appreciated.

Regards

Sagar

7 Replies
MayilVahanan

Hi

Is it P_Month format correct?

Edit: Missed $ dollar.

=sum({$<MonthYear={"$(=Date(AddMonths(today(),-1),'MMM'))"}>}Headcount)

or

=sum({$<MonthYear={"$(=Month(AddMonths(today(),-1)))"}>}Headcount)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Chanty4u
MVP
MVP

Try:


=sum({$<P_Month={"$(=month(addmonths(today(),-1)),'MMMM')"}>}Headcount)

Anil_Babu_Samineni

Chanty,

How come Month() applies MMMM. Use Date()

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
neha_shirsath
Specialist
Specialist

What is the date format of P_month?

try this-

sum({$<[Month Name]={"$(=Monthname(addmonths(today(),-1)))"}>}Value)

sunny_talwar

May be this

=Sum({$<P_Month={"=Only({1}P_Month) = MonthStart(Today(),-1)"}>} Headcount)

or

=Sum({$<P_Month={"$(=Month(MonthStart(Today(),-1)))"}>} Headcount)

sagar_vij99
Creator
Creator
Author

Ohh yes i missed the $ sign,, Thanks for the reply.

Just for better understanding when we use formulas in set analysis then we have to use $ sign. What it actually indicates while execution..??

sunny_talwar

Check this link out

The Magic of Dollar Expansions