Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a Qlik Document where there are some Documents in a table.All documents have some fileds like Code, Unit,Value and Issue Date.
I put in the report Two input box where a user can insert a Range of Date to select only the documents that have the Issue Date in the range.
The problem is:If a user Insert a Date Range that have some docouments with the Issue Date included in the Range all works Ok but, if a user insert a Range of Date where there aren't Documents with the Issue Date included in the range instead to have the table empty with no records I have all Documents.Seems that that filter doesn't take,Infact in the "current selection" no filter appears.There is a way to slove this?
the macro that I use is:
sub Set_Date
set Ibox = ActiveDocument.GetSheetObject("IB01")
set Ibox2 = ActiveDocument.GetSheetObject("IB02")
if Ibox.getrawcontent(0) <> "" and Ibox2.getrawcontent(0) <> "" AND ISDATE(Ibox.getrawcontent(0)) AND isdate(Ibox2.getrawcontent(0)) then
if cdate(Ibox.getrawcontent(0)) > cdate(Ibox2.getrawcontent(0)) then
msgbox "ReceiptFrom Date should be < to To Date"
ActiveDocument.Fields("REC_DATE").Clear
exit sub
end if
FDate = Ibox.getrawcontent(0)
TDate =Ibox2.getrawcontent(0)
Ibox.SetVariableContent 0,FDate,true
Ibox2.SetVariableContent 0,TDate,true
ActiveDocument.Fields("REC_DATE").Clear
ActiveDocument.Fields("REC_DATE").select cstr(">=" & FDate & " <=" & TDate)
else
msgbox "Insert Corect Date"
ActiveDocument.Fields("REC_DATE").Clear
end if
CurrSelection
end sub
Many Thanks,
Did you get any solution? I am facing same issue.
No, unfortunatly I don't find any solution 😞
You're telling QlikView to clear the field, then select any values in the range. There are no values in the range, so the field remains cleared. There's no concept of "select none".
One option would be to put a calculation condition (properties -> general) on your chart, such as getselectedcount(Date). That way, the chart would only calculate if a Date had actually been selected. The default message will be "Calculation condition unfulfilled". To override it, properties -> general -> error messages -> calculation condition unfulfilled -> enter your custom message in the custom message box. You could use a message like "There is no data for the dates in the specified range."
Hi,
Many thanks for the answer!!
You are right 🙂 i can use the calculation condition on the chart.I didn't think this possible solution.:-)
Many thanks and best regards!