I am using an If expression in variable as well as the same expression in text object in front end then in front end the expression giving expected result but the same if used in a variable, not giving expected result , hence want to understand this behaviour of Qliksense
Below is the expression
If( getfieldselection (datefield)='$(vnow)',1,0)
Vnow has today's date stored
Here, when datefield had the same date as that of vnow variable, then it should show 1 else 0.
This expression is working as expected in front end but the same is not working as expected in variable
Want to understand if there is any solution available on this behaviour
Can you explain what you mean with "using an If expression in variable"? Are you talking about creating a field in the load script or about a variable in the sense of Qlik Sense and programming languages?
I am defining a variable in variable panel which is available in asset panel and in the variable I am using below expression :
In above expression vnow variable has already been created in load script and it is holding today's date based on the daily reload.
Now I want to hide the table data when user will select any date from date field , for that I used button object, so that when user will select any date from datefield filter the table content should get hidden and when user will click on button object the content of table will visible...once the contents visible ..again if user change the date the content should get hidden based on selection and after clicking on button object the content should visible... The button object is used to show hide table content...
Now the problem which I am facing is ...when I select the date apart from today's date then the logic is working fine...but again if I select some other date apart from previous selection...the table content still visible..it is not getting hidden ... actually I want to hide table content on every selection of date field data...and once the table content are hidden...user can click on show content button to see the data...
Now this workaround is easy to implement in Qlikview using on select option in field event trigger...but it is little challenging in Qliksense...
When I am using the same expression in text object in front end there it is showing expected result based on changing dates from today's date to some other dates...but the same expression through variable is not giving expected result when I am using that variable in front end.
Hence I want to understand whether it is a bug in Qliksense or is there any solution available on this behaviour