Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Variables in QlikSense

Hi everyone,

I've created four different variables as follows, however they're not working as expected. I'd like to know whether my reasoning was right or not.

1. I have a range selection of dates. Let's say, in a filter box, I've selected all dates from (DD/MM/YYYY)

    06/03/2013    to    07/05/2013              Field I'm taking into account is [Date picker]

2. I've set this variable, vMinDate

    =min([Date picker])

    this should return 06/03/2013

3. Third variable vYearDate

    =date(Yearstart(date#($('vMinDate'),'DD/MM/YYYY'),'YYYY')

    this should return 2013.

4. Fourth variable vYearJan

    =MakeDate($('vYearDate'))

    This should return 01/01/2013

Basically, selecting 06/03/2013 to 07/05/2013 in my [Date picker], by specyfing $('vYearJan') in an expression, I should get 01/01/2013.

Am I right? Or am I mistaking something while specifying these variables?

Thanks for your help.

Tags (3)
1 Solution

Accepted Solutions

Re: Variables in QlikSense

HI,

Is there any specific reason why you want to use 3 to 4 variables when it can be done in one.

Your variable should be as per me.

Date(Yearstart(Min([Date Picker])),'DD/MM/YYYY')

It will return you the first date of the year.

Regards,

Kaushik Solanki

2 Replies

Re: Variables in QlikSense

HI,

Is there any specific reason why you want to use 3 to 4 variables when it can be done in one.

Your variable should be as per me.

Date(Yearstart(Min([Date Picker])),'DD/MM/YYYY')

It will return you the first date of the year.

Regards,

Kaushik Solanki

Not applicable

Re: Variables in QlikSense

I'll probably have to use them further in the future for creating other expression, but anyway, your expression should do the job.

thx