Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
ronaldwang
Creator III
Creator III

using functions within set analysis

  In set analysis, can I use function to specify criteria? For example, I have date field available and I want to add up the current year data

 

 

Can I do something like sum({<YearName(date)= YearName{'$(=vCurrentCMonthYear)'}>}Amount)

 

Seems like it does not work as there probably different syntax I shoulde use for YearName(date)?

 

1 Solution

Accepted Solutions
Anil_Babu_Samineni

No, You can't as Qlik has limit of left part of equal symbol not entry with calculated

You can try That in script like YearName(date) as date_set

then call it as

sum({<date_set= {'$(=YearName(vCurrentCMonthYear))'}>}Amount)


You can play with variable if equal / single quote issues ..

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

View solution in original post

6 Replies
prma7799
Master III
Master III

Try like this

=Sum({<[Posting Date] = {"=YearName(Today())"}>}[Amount])

What is your value in vCurrentCMonthYear

its_anandrjs

No not this ways what is the value in vCurrentCMonthYear

Anil_Babu_Samineni

No, You can't as Qlik has limit of left part of equal symbol not entry with calculated

You can try That in script like YearName(date) as date_set

then call it as

sum({<date_set= {'$(=YearName(vCurrentCMonthYear))'}>}Amount)


You can play with variable if equal / single quote issues ..

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
ronaldwang
Creator III
Creator III
Author

thanks, that is what I want to confirm before going to the variable part

ronaldwang
Creator III
Creator III
Author

is the current month and year like Sep-2017

its_anandrjs

You can do this with the NumMonth and Year field also which is dynamic to you also.

=Sum({<YearField =  {"$(=Max(YearField))"}, NumMonth={"$(=Max(NumMonth))"}>} Amount)