Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Use of < in a buttons search string

I have data from 2012 and 2013 and want to se them represented in a chart with month number as the x axis. This is ok, but i also want to limit the dates so only transactions year to date are shown when I activate the button.

I have tried to do thes by giving each transaction a datepart "dy" returning 1 to 365 on each transaction.

Now - what I want the button to do is to limit this by datepart(dy,getdate()) returning todays number in a side tabel.

This works fine with "=(Todaysnumer)", but with the limitation "<(Todaysnumer)" it does not work.

But if I change this to "<(305)" it does exactly what I want and count only transactions eache year before 31/10.

Any ideas why it does not work with "<(Todaysnumer)", when i works with "<(305)"?

Thanks.

1 Solution

Accepted Solutions
MVP
MVP

Re: Use of < in a buttons search string

You want QV to evaluate Todaysnumer, right?

Then try

='<'&Todaysnumer

as search string, which should result in an evaluated search string, e.g.

<305

3 Replies
salto
Valued Contributor II

Re: Use of < in a buttons search string

Hi,

I did it with this, that shows tha sales until today for the maximum year selected:

=sum({<Year={$(=max(Year))},DateID={"<=$(=date(addmonths(CurrentDay,-(CurrentYear-Max(Year))*12)))"}>} SalesAmount)

Being DateID the date of the transaction, and CurrentDay is Today() in the script.

HTH.

MVP
MVP

Re: Use of < in a buttons search string

You want QV to evaluate Todaysnumer, right?

Then try

='<'&Todaysnumer

as search string, which should result in an evaluated search string, e.g.

<305

Not applicable

Re: Use of < in a buttons search string

Thanks. It was that simple. Now it works fine, and will show last year vs this year to the date.

Thanks.

Community Browser