Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
mbjallow6
Contributor III
Contributor III

qsVariable

I am trying to use the qsVariable extension in other to allow the user to input (>digits) or l(< digits) then the visualization can be sorted according to the value.

Sum({$<Fact={$(#vSum)}>}Fact)

i use the syntax above to create an app. however, it doesnot recognize the following symbols (< >)

thank you.

16 Replies
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Ok,

My expression is correct. What you have done is you have copied and pasted the exact expression from my post where "" marks were changed to some other characters (note difference between "" and “”)

So once again use this formula from below and it will work!

Sum({<Dim = {"=Sum(Fact)$(vSum)"}>} Fact)

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

I also would add anther variable which would control sign just to avoid any issues with syntax...

Attached is my sample app.

Hope this helps

1.png

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
mbjallow6
Contributor III
Contributor III
Author

Thank you so much for the support.

I have finally worked as i wanted.

mbjallow6
Contributor III
Contributor III
Author

the previous solution have worked just fine. However, i am faced by a more complex requirement.

from the previous solution how can i improve on the syntax in order for the user to be able to enter ">1000 <2000" that is to say greater than 1000 but less than 2000. Furthermore, how can i make sure that only data within the past 12 month is filter.

Thank you in advance.

 

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

you need to create another variable as your condition cannot exist in single variable... and embed it in your extended expression.

 

Expression will look like this (note * union character between sets):

Sum({<Dim = {"=Sum(Fact)>$(vSum)"}*{"=Sum(Fact)<$(vSum2)"}>} Fact)

or when using additional variable for <= sign.....

Sum({<Dim = {"=Sum(Fact)$(vSign)$(vSum)"}*{"=Sum(Fact)$(vSign2)$(vSum2)"}>} Fact)

 

Regarding your "Last 12 Months" question there are multiple ways of achieving the same:

  • Users need to apply selections direcly in Qlik Sense
  • You can harcode Last 12 months in set analysis expression (given that you have properly loaded and formatted date field) like this: Sum({<Date={">=$(=AddMonths(Today()-12))<=$(=Today())"},Dim = {"=Sum(Fact)$(vSign)$(vSum)"}*{"=Sum(Fact)$(vSign2)$(vSum2)"}>} Fact)
  •  You can create Last 12 months flag in script calendar and use flag as selection or in set analysis

1.png

Regarding your "Last 12 Months" question....This was very basic question you asked and I really suggest you learn little bit of Qlik Sense first before asking them (go through help.qlik.com (text and videos), go through blogs etc.. or even get a basic 5 day training from Qlik Partner or Qlik) .

I do not want to be harsh but i think there needs to be a minimum level of knowledge when we discuss things here.

Attached is document with all options implemented!

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
mbjallow6
Contributor III
Contributor III
Author

Thank you.

well regarding the last 12 months question, maybe i have not framed the question well. because already i know how to filter the last 12 months data. the issue i have actually is i am using about 5 measures in one bar chart. and there are times that some of the measures will not have data and the dimension field will still appear without any bar against it.

so what i wanted to achieve is any time that a filter is performed, if a particular measure does not have data, then the rest of the other measure should not appear.

I am sorry for any inconvenience. I am new in qlik but i am determine to learn. i have a qlik continues classroom account also i have subscribe to most qlik channels on youtube. 

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

I see,

this is then different topic and you should open different topic/question for it as on community we try to stick to subjects and dont jump from one to another questions within the same thread.

cheers

 

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.