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

Switch YTD to 30 Day Button click

Is there a way that it's possible to create a button where I can just switch from YTD data to recent 30 days.

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

The answer is still yes.  Can be conditional load:

IF VAR='YTD'

   <load script>

ELSE

    <another load script>

ENDIF

But this is not the right way to use QlikView.  Normally you load all relevant data, and use selections/conditions/whatever on the front end, rather than reload different data every time.

View solution in original post

4 Replies
Anonymous
Not applicable
Author

The answer is yes.  You didn't ask how, but just in case a simple example is attached.

Not applicable
Author

In a way I want the button to be able to change the where clause in the following sql

SELECT DATENAME(month,CREATED) as [Month],

    DATEPART(Year,Created) as [Year],

    COUNT(ID) as [NumberOfTickets]

from

where

  CREATED BETWEEN DATEADD(yy, DATEDIFF(yy,0,'2014-12-31'),0) AND '2014-12-31' -- this can be used as year to date

group by DATENAME(month,CREATED),

      DATEPART(Year,Created),

      DATEPART(month,CREATED)

order by

  DATEPART(Year,Created),

     DATEPART(month,CREATED)

or maybe for every button it loads a different sql statement.

Anonymous
Not applicable
Author

The answer is still yes.  Can be conditional load:

IF VAR='YTD'

   <load script>

ELSE

    <another load script>

ENDIF

But this is not the right way to use QlikView.  Normally you load all relevant data, and use selections/conditions/whatever on the front end, rather than reload different data every time.

Not applicable
Author

Thanks for your help!