Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need help in writing expressions

I need to display a chart which should show ouput by taking run time variables. for eg two buttons are displayed, one representing qtd and other is mtd.

when i click qtd, chart should show the data based on qtd.

How do i achieve these through expressions?

Need help on urgent basis,

Thanks,

Praveen.

15 Replies
Not applicable
Author

jagan,

In your above said expression, max(date) this date refers to general date or departure date.Also i am getting syntax error for your expression.

Please help,

Not applicable
Author

jagan,

finally the expression worked, thanks for that. But the buttons doesnt seem to work. It displayes the expression in a text box. when i click any of the two button, the values remain unchanged!!

Any idea towards this?

jagan
Luminary Alumni
Luminary Alumni

Hi,

Please check the attached example.  If possible can you attach your application.

Regards,

Jagan.

Not applicable
Author

I am using a personal edition of qlik view which has very limited options and i am unable to open your file because of licensing issues.

Can u send me some screenshots that might may help me.

Thanks,

Praveen.

Not applicable
Author

jagan,

however i managed to open the file. You are using two text boxes, in my case there is only one text box. I need to show the values based on the ytd or qtd button, is there i need to give some expressions in enable field for button properties?

jagan
Luminary Alumni
Luminary Alumni

Hi,

If you are using single textbox, then you select

Chart Properties -> Layout -> Show Always

and now you use this expression

If(vType = 'YTD', Sum({<Date={'>=$(=YearStart(Max(Date)))<=$(=Today())'}>} DISCHARGE_TIME - ADMISSIONTIME),

     Sum({<Date={'>=$(=QuarterStart(Max(Date)))<=$(=Today())'}>} DISCHARGE_TIME - ADMISSIONTIME))

where vType is a variable which you created earlier.

Regards,

Jagan.