Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
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.

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

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

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

2 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

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

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

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

thx