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

Only show a chart if the user has selected a range of dates

I have the standard date fields in my dashboard, invoice_year, invoice_month, invoice_week, and invoice_date.

I only want to show a chart if the user has selected a date range to show the transactions over.

I know I could do something similar to if ((GetSelectedCount(invoice_year)>0) or (GetSelectedCount(invoice_month)>0) .....

Is there a better way of doing this just using the invoice_date field?

Thanks

Andy

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

you could use this condition to compare the possible dates  against all the dates:

Count({$} distinct invoice_date) < Count({1} distinct invoice_date)

or

GetPossibleCount(invoice_date) < FieldValueCount('invoice_date')

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

4 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

you could use this condition to compare the possible dates  against all the dates:

Count({$} distinct invoice_date) < Count({1} distinct invoice_date)

or

GetPossibleCount(invoice_date) < FieldValueCount('invoice_date')

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
hic
Former Employee
Former Employee

GetSelectedCount() is not the optimal function to use. Then you demand that the selection is made in this specific field, not in another one. You could for instance have a field "Month" where the user makes a selection, so that only 30 days are possible.

No, I suggest you use

     Count( distinct invoice_date ) <= 30

as condition. Then any selection that results in less than 30 days will trigger the chart to show.

HIC

alexandros17
Partner - Champion III
Partner - Champion III

In the conditional view of the object:

GetSelectedCount(invoice_date) > 0

Not applicable
Author

Thanks everyone for your help