Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
sturmeyp
Contributor II
Contributor II

Help on Set Analysis expression

Hi All

Could someone help me on syntax for a set analysis expression

The purpose is to calculate sales value for Year to date.

The expression below works OK but as you can see I've hard coded the month values

Month 1 is OK as that will never change but I need a way to get current month value

So for example how to I replace 6 with a function or variable?

if(vDateRangeSelection = 'YTD',

Sum({1<Month = {">=1 <=6"},

[Year]={'2018'},

[Customer Type]={"External"}

>} [Potential Value])*vCurrencyRate,))

any help appreciated

Paul

5 Replies
petter
Partner - Champion III
Partner - Champion III

If you already have a current month calculated and stored in a variable you could just replace the 6 with $(vCurrMonth).

If you want to calculate it when the chart is rendered you can replace the 6 with something like:

$(=Num(Month(Today(1))))

sturmeyp
Contributor II
Contributor II
Author

thanks Petter,

The second option worked best for me ... (using $(=Num(Month(Today(1))))

One question ...what does the 1 mean after the today part of the expression?

Paul

yashdeep
Contributor III
Contributor III

today([ timer_mode])


Can have the following values:

0 (day of last finished data load)
1 (day of function call)
2 (day when the document was opened)

petter
Partner - Champion III
Partner - Champion III

Can you please mark the thread and the response that was correct as answered?

sturmeyp
Contributor II
Contributor II
Author

Hi Petter

I don't see any option in the thread to mark it as correct or answered? 

On the response I only see 'Mark as Helpful; and on the thread I don't see any actions at all


Any advice?

Paul