Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to make our design flexible?

Hi

i am having dashboard in which i have comparison of sales based on year and season. I want to compare 2015 year sales with 2017

how to implement the same ?

qlikckk.pngthe date represented above chart as 2016(is a text box in which under text option it is written as (=prev_year)  has following coding in the script

Let currentdate =DATE(Today(1)-1,'YYYYMMDD');
Let Curr_Year = Year(Today());
Let Prev_Year = (Year(Today())-1);

4 Replies
MK9885
Master II
Master II

Alternate States?

hallquist_nate
Partner - Creator III
Partner - Creator III

You could use Set Analysis to do this, I think.  You use a Set expression like Year = {"$(=Max(Year))"} In your formula.  It might look something like....

Sum({$<Year = {"$(=Max(Year))"} >} Sales)       //This is for Current year sales, or "max selected year".

Sum({$<Year = {"$(=Max(Year)-2)"} >} Sales)       //This is for the Max selected year -2, or 2015. 


You would use these as 2 different expressions in your chart and you would be able to get your two different years.


Hope this helps.


Nate

Anonymous
Not applicable
Author

yes

inhereted

Anonymous
Not applicable
Author

I have assigned following values to my variables in the script itself

Let currentdate =DATE(Today(1)-1,'YYYYMMDD');
Let Curr_Year = Year(Today());
Let Prev_Year = (Year(Today())-1);

then i have used this variables curr_year and prev_year in my chart expressions

=num(

sum(if(Sold_Date <= MakeDate(Prev_Year,month(To),day(To)) and Sold_Date >= MakeDate(Prev_Year,month(From),day(From)),  [inv value]))/Sales_INR_Unit,

'#,##0.0')

now i want to assign the variable curr_year so that it can show comparison between any season les than  2017 ie curr_year



so what changes i have to do for the same in my variable declaration?