Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Welcome to Qlik Community! Check out our new navigation! FIND OUT MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
aatish12345
Creator
Creator

Qliksense behaviour

Hi all, 

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

 

Regards,

Aatish

4 Replies
GaryGiles
Specialist
Specialist

How are you defining the variable expression?  In your load script?  In the Qlik Sense application via the variable panel?

One thing you may want to look at is when the $(vnow) is getting expanded.  Is it when you define the variable?  If so, that may be causing the issue.

When you say it is not working, what is showing?  

 

 

Gysbert_Wassenaar

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?


talk is cheap, supply exceeds demand
aatish12345
Creator
Creator
Author

Hi Gysbert and Gary

I am defining a variable in variable panel which is available in asset panel and in the variable I am using below expression :

If(getfieldselection(datefield)='$(vnow)',1,0)

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...

Hope it clarified your as well as Gary's doubts 

aatish12345
Creator
Creator
Author

Adding to above points...

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

 

Regards,

Aatish