Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
MVP
MVP

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))))

Highlighted
Contributor II
Contributor II

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

Highlighted
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)

Highlighted
MVP
MVP

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

Highlighted
Contributor II
Contributor II

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