Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

Newbie Question - Month & Year Selector

Hi all

Easy one for you to resolve this I am sure! First post so please be gentle also!

I have tried the usual search engines for 'month selector qlikview' etc and am getting nowhere.

I would like to include on my sheet a list of months and years, say 2010 -2020, so that the user can simply click on the year and the data is adjusted to just show that selection. For example 2013 or Jan 2015 etc.

The field I am using is Date Received.

When I tried creating a list box from this field I get every date, not for example just the month or year. Even when I change the date format to mmm or yyyy I will get a list box that shows Mar Mar Mar Mar Mar Apr Apr Apr etc... if 1st March, 2nd March, 3rd March etc is the Date Received.

I KNOW I am missing something simple! I am not a developer nor am fluent in any coding! I am merely stepping across from excel

All help gratefully received

Thank you in advance

Tags (1)
1 Solution

Accepted Solutions
Not applicable

Re: Re: Newbie Question - Month & Year Selector

press CTRL + E  - Then you enter the script mode.

Here you can connect to a DB or whatever you have (excel maybe?)

Capture.PNG.png

Then you can add the file/table and then you should use examples like above

Year(Datefield) as Year

Month(Datefield) as Month

and so on.

9 Replies
Highlighted
anantmaxx
Valued Contributor

Re: Newbie Question - Month & Year Selector

use this in your script

Load

Year(DateReceved) as Year,

Month(DateReceved) as Month

x,

y

from your table<>;

now use list boxes Year and Month and select Year and month from your sheet

anant

israrkhan
Valued Contributor II

Re: Newbie Question - Month & Year Selector

you need to create Month and Year Fields in the load script,

like below:

Load *,

A,

B,

Date Received,

Month(Date Received.) as Month,

Year(Date Received) AS Year,

from

abc...


then on the front end you will have month and Year fields, and you can chose these fields for your list boxes..


try this, or share sample file...

Not applicable

Re: Newbie Question - Month & Year Selector

Thank you both for your responses. As a total newbie to QV, how do I achieve what you have both posted?

Is there any pictoral guide to assist in basics like this?

I hope I dont come across as ungrateful, I am grateful, just not experienced in QV!!!

Not applicable

Re: Newbie Question - Month & Year Selector

Hi Billy,

You can follow the below steps:

1. Open your Qlikview document, then press ctrl+E or in your navigation bar click the icon Edit.bmp, it will open the script editor.

2. Here you can write your code/script as mentioned by Anant Dubey or IsrarKhan.

3. Once done, you can save the file and reload.

4. In the front end, right click and select "New Sheet Object" -- List box.

5. Then select the respective Year field that you have created alraedy.

6. Repeat step 4 & 5 for Month as well.

Hope this helps!

Not applicable

Re: Re: Newbie Question - Month & Year Selector

press CTRL + E  - Then you enter the script mode.

Here you can connect to a DB or whatever you have (excel maybe?)

Capture.PNG.png

Then you can add the file/table and then you should use examples like above

Year(Datefield) as Year

Month(Datefield) as Month

and so on.

Not applicable

Re: Re: Newbie Question - Month & Year Selector

Aha, thank you... I think I am getting somewhere now...

I have managed to understand that and enter it in to the script, thank you.

I now have a list box but it is in one column...

Mar

Apr

May etc

I have had a wander round the properties and cant Find how to display the options in a grid format such as the pic below

table.jpg

Not applicable

Re: Re: Newbie Question - Month & Year Selector

Hi,

In properties, go to Presentation tab, uncheck the follwoing option:

lb.bmp

Once done, reduce the height of your list box and keep on increasing the width unless the scroll bar disappears.


Not applicable

Re: Re: Newbie Question - Month & Year Selector

Thank you again for the prompt response.

Very strange, I dont have single column under the Presentation tab!? My QV version is 11.20.11922.0 SR2

I am using a list box, have I got the right object?

I also checked the other tabs and see no mention of single column?

Not applicable

Re: Re: Newbie Question - Month & Year Selector

IGNORE ME!

Sorted it!!!

Thanks to all for the help