Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

sibrulotte
Contributor III

Action select field multiple values- YTD

Hi,

so I'd like to do a YTD on this field  [Année-période financière] which is USUALY a single selection. 90% of the time actually.

It has values like 2014-06, for the 6th period of 2014.

I'm trying to do a button that selects from the : GetFieldSelections ([Année-période financière]) all the way down to the fisrt period of the same year.I've seen alot of threads discussion values that can be seperated by Pipe delimiters, but not alot on arrays.

Does anyone care to help?

Thank you


1 Solution

Accepted Solutions

Re: Re: Action select field multiple values- YTD

How about the attached (some details inside).

8 Replies
sibrulotte
Contributor III

Re: Action select field multiple values- YTD

I think I am on to something with the CONCAT function:

 

='('&CONCAT({<[Année-période financière]={"$(< GetFieldSelections([Année-période financière]))"}>} DISTINCT [Année-période financière],'|')')'

but my set analysis is all crooked, and I need to put a lower limit in there...

Re: Action select field multiple values- YTD

I'm not absolutely sure of what you're asking for.  Can you please given an example like "If ___ date is selected, then I expect the button to select dates from ____ to ____"?  There is an easier way to do this than using concat(), I just need to understand what you're trying to do.

sibrulotte
Contributor III

Re: Action select field multiple values- YTD

Sorry,

I had Year To date in mind, and did not explicit the YTD accronym.

If I have 2014-06 selected, I would like the button to select 2014-06, 2014-05, 2014-04, 2014-03, 2014-02 and 2014-01.

If I have 2014-12 selected, I would like the button to select 2014-12, 2014-11... down to 2014-01

Re: Re: Action select field multiple values- YTD

If you're 2014-06 field is a date field, you could do it using the search string:

='>='&yearstart(min(DateField))&'<='&max(monthend(DateField))

See the attached for an example.

sibrulotte
Contributor III

Re: Action select field multiple values- YTD

Yes Rob Wunderlich had a great example in his cookbook on setting a Yesterday, lastweek, last month, etc

But my field is not a date. It's the caracters '2014-06'

Re: Re: Action select field multiple values- YTD

How about the attached (some details inside).

sibrulotte
Contributor III

Re: Action select field multiple values- YTD

That works great!!!
You get a green star.

Thank you.

Re: Action select field multiple values- YTD

Glad it works for you

Community Browser