Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
LP27
Creator II
Creator II

Input Box variable extension-how to display default data without entering min and max in input box.

Hi Everyone,

 

Could someone guide me how to use input box Variable Extension for the below scenario-

Firstly I have created 2 variables 

  • vMin_Invoice_Amt= Min(Invoice Amount)
  • vMax_Invoice_Amt=Max(Invoice Amount)

I am using two Input Box -

  • Input Box 1 to enter starting value = Min(Invoice Amount)
  • Input Box 1 to enter Ending value =Max(invoice Amount)

Now I have written If condition for Invoice Amount column - 

if(Sum([Invoice Amount])>= $(vMin_Invoice_Amt) and sum([Invoice Amount]) <= $(vMax_Invoice_Amt),sum([Invoice Amount]))

This filters accordingly the value entered in Input Boxs, But I want to display everything if there are no values entered in Input Box. Like show everything initially when users enters there input in the boxes it should filter accordingly. 

 

Let me know if the is clear!

 

Thanks in advance

 

Labels (4)
3 Replies
dplr-rn
Partner - Master III
Partner - Master III

Not completely clear.. wont you have a default value for the input boxes. vMin_Invoice_Amt?

i am assuming you are asking about scenarios where one or both of the values are empty.

if so just add an empty condition to your if statement e.g. if(len(variable)=0....

let me know if i am missing something

 

LP27
Creator II
Creator II
Author

Yes your right! 

I wanted  a logic where one or two values are empty. 

Do i use it like this- 

if(len(vMin_Invoice_Amt)=0 or Sum([Invoice Amount])>= $(vMin_Invoice_Amt) and sum([Invoice Amount]) <= $(vMax_Invoice_Amt),sum([Invoice Amount]))

Correct me if i am wrong!

dplr-rn
Partner - Master III
Partner - Master III

you will need nested if loops

roughly

if (len($(vMin_Invoice_Amt))>0 and len($(vMax_Invoice_Amt))>0
, if(Sum([Invoice Amount])>= $(vMin_Invoice_Amt) and sum([Invoice Amount]) <= $(vMax_Invoice_Amt),sum([Invoice Amount]))
 , if (len($(vMin_Invoice_Amt))=0 and len($(vMax_Invoice_Amt))>0,if(sum([Invoice Amount]) <= $(vMax_Invoice_Amt),sum([Invoice Amount]))
,....
)
)
)