Discussion Board for collaboration related to QlikView App Development.
I need a 2 way filter with functionality similar to a radio button with 2 options
a) Current Year
b) Last 12 months
It should work in such a away that if i select a)current year , only the data corresponding to current year (from january to current month) need to be shown.
But if select b) Last 12 months, the data corresponding to last 12 months ie (2016 June to 2017 July) is to be shown.
Please help me in implementing this.
Thanks in adavance
Depending on where you want to use this, you can decide the logic.
If in Bckend (In Script)
Create 2 fields in your master cal i.e to find the current year and last 12 months.
If in FrontEnd.
Use the start and end variable to manipulate as per the selection and use those variable in set analysis to filter data.
Create 2 buttons
1 for Current Year and 2nd for last 12 months
create Variable which store button action say vYearToDisplay
set below property on Button Current Year
Button > Property> Action > External > Variable Name : vYearToDisplay
similar for Button Last 12 Year
set below property
Then In char write expression
if(vYearToDisplay="currentYear",YourCurrentYear Expression,Last 12 Expression)
Can you pls explain the first option in detail? i am very new to this.
Is it like seprate columns which could give 2 flag values for the months ?
Month Current year Last 12 months
june 2016 0 1
july 2016 0 1
aug 2016 0 1
dec 2016 0 1
jan 2017 1 1
frb 2017 1 1
july 2017 1 1
Let vMin = num(MakeDate(2016));
Let vMax = Floor(MonthEnd(Today()));
Load Date($(vMin) + RowNo() -1) as Date
While Date($(vMin) + RowNo() -1) < Date($(vMax));
Load Distinct MonthEnd(Date) as MonthEndDate,
Ceil(Rand()*1000) as Sales
'Current Year' as FLag
Resident Temp where Date >= YearStart(Today());
'Last 12 Months' as FLag
Resident Temp where Date >= Addmonths(MonthEnd(Today()),-12);
Drop table Temp;
i tried using this button.Qlik Branch
But i cannot use the variable i set in the button properties in the expression.
i used a kpi with following expresion to display a value to test it
if (Checkbox_Var1=true ,1,0)
but it's not working.. can u pls help on this?