Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
pranaview
Creator III
Creator III

How to show data for last year if by default we show data only for current year

Hi Guys,

I'm stuck in a problem and need help!

Problem: So, I have built a dashboard in which I show the Count of deliveries from last year(whole of 2018) if the current month is January(like it is today) but when we move on to Feb, I'll be showing count for only Jan-2019 and when we move onto March, I'll be showing count for Jan 2019 and Feb 2019(You get the point). This is all fine but now the client also wants to have the ability to view the 2018 records even if we are in Feb-2019 and beyond.

I have added the aforementioned logic in the expression of charts but Now I don't know how to show the data for 2018 when we are in Feb-2019, cos according to my expression if it's Feb, only the count of Jan-2019 will be shown. I am kinda confused here. so any help will be hugely appreciated as  need to get this done quickly.

Cheers,

Pranav

Labels (3)
12 Replies
pranaview
Creator III
Creator III
Author

Sample of the data?
I got your point regarding the button. But I don't know how to switch on/off just the expression though.
One thing that i can do is(which doesn't seem like a good approach at all to me) to create a variable for for show/hide all the charts if the user clicks on the button to show only last year data which means I'll have to create a replica of all the charts and in one set I'll keep the current expression which is based on the current month condition and in the second set of the charts, i will keep the expression only for last year.
sunny_talwar

You button will have an action to change variable value... just like you would do for turning the chart on/off

If(vVar = 1, 0, 1)

and then you would do this

If(vVar = 1, Expression1, Expression2)

Does this make sense?

pranaview
Creator III
Creator III
Author

Yeah, It makes perfect sense. Let me try it out. Thanks, Sunny!!