Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Become an analytics expert with Qlik's new 15 week course: Applied Data Analytics using Qlik Sense. READ MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

button & bar chart problem

i have one bar chart and one button in that button two clicks are their one is current selection and another one is 12 months

if i click the current selection the bar chart it display the current seletion data . and click 12 months it display current selection-12 months data in bar chart. plz tell me urgent....

7 Replies
MK_QSL
MVP
MVP

Provide sample data please...

senpradip007
Specialist III
Specialist III

Use two expression with conditional enable facility.

For 12 month data

Sum({<Date={'>=$(=AddMonths(Max(Date),-12)) <=$(=Max(Date))'} >} Value)

MayilVahanan

Hi

Try like this

Current selection

=Sum({<DateField = {">=$(=MonthStart(Max(DateField))) <= $(=Date(Max(DateField)))"}>}MeasurementField)

Current selection - 12 month

=Sum({<DateField = {">=$(=MonthStart(Max(DateField),-12)) <= $(=Date(Max(DateField)))"}>}MeasurementField)

You can replace 12 in variable and use it in the button also and optimize in one expression.

Thanks & Regards,
Mayil Vahanan R
Not applicable
Author

in the above statements in place of measurement field I use count( if(op_status='won',op_status))/count(op_status)

it work or not other wise plz give information about this... urgent

Not applicable
Author

any one plz help me

MayilVahanan

Hi

Try something like this

count({<DateField = {">=$(=MonthStart(Max(DateField))) <= $(=Date(Max(DateField)))"}, op_status={'won'}>}op_status))/count({<DateField = {">=$(=MonthStart(Max(DateField))) <= $(=Date(Max(DateField)))"}>}op_status)

Thanks & Regards,
Mayil Vahanan R
Not applicable
Author

i am calculating the both current selection and 12 months in bar chart . in button object wrote this code like if(vtogle_something='last',12months,current selection)

i m using this code to write the expression in bar chart  like (if vtogle_some='last',

i don't next  and also using the condition(expression like rate%

count( if(op_status='won',op_status))/count(op_status) to display the bar chart corresponding clicks in one button object plz tell me the working expression........plz........urgent