Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
omyahamburg
Creator II
Creator II

limit data in table by variable

Dear all

I am struggling.

I have a table as follows:

overdue amount.png

To calculate the days overdue I use the expression today()-[Due Date].

Now I want use a variable, e.g. vDay=500 and I like to limit the data in the table

only to show me those rows, where today()-[Due Date] <= 500 is.

I appreciate your help.

Joerg

1 Solution

Accepted Solutions
Not applicable

Hello Joerg,

You can also avoid using an addition button, by using

=if(Today()-[Due Date] <= if('$(vLimitData)' = '',Today()-[Due Date],$(vLimitData)),[Document No])

instead of your [Document No] dimension.

Please find attached qvw.

Thanks,

iota

View solution in original post

12 Replies
Anonymous
Not applicable

HI,

1. create a Input box , declare a global variable  and attcahe  that variable to input box.

2. In your Sum(AMOUNT) expression write this expression  if(today()- [Due Date ] <=500,SUM(AMOUNT))

   

      now when you enter a value in input box press enter key by which variable will be set by a value.

      to clear  variable value create a button named clear and setvariable to 0. 

Regards,

ANANT

Not applicable

Hi

Go to dimension click on edit Document No dimension and replace with following expression :

=if (Today()-[Due Date]>=500 , [Document No])

Thanks

vikasgupta
Creator
Creator

Hi

Find the sample !!

omyahamburg
Creator II
Creator II
Author

Dear Vikas, dear anantmax

I combined both your solutions.

I created a variable vDay and changed the Document No dimension with the following expression : 

=if (Today()-[Due Date]<=vDay , [Document No]) and selected suppress zeros.

In the input box I can now "play" with the different values.

Also I created the mentioned button to set the variable:

=max(today()-[Due Date])

This sets the table back to show all values.

Thank you both for your help.

Have a good weekend.

Joerg

Not applicable

Hello Joerg,

You can also avoid using an addition button, by using

=if(Today()-[Due Date] <= if('$(vLimitData)' = '',Today()-[Due Date],$(vLimitData)),[Document No])

instead of your [Document No] dimension.

Please find attached qvw.

Thanks,

iota

omyahamburg
Creator II
Creator II
Author

Dear Itsangad

A very nice solution. This should fit my needs best.

Have a good weekend.

Joerg

Not applicable

Thanks Joerg !

Please mark the question as answered.

Have fun !

Thanks,

itsangad

omyahamburg
Creator II
Creator II
Author

Dear Itsangad

Do you have also an idea how I can achieve this ?

overdue amount1.png

Joerg

Not applicable

Hello Joerg,

The same has been implemented in the attached qvw.

Please let me know, if you find it helpful or anything else is required.

Thanks,

itsangad