Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
Not applicable

Re: limit data in table by variable

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
Highlighted
Specialist
Specialist

Re: limit data in table by variable

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

Highlighted
Not applicable

Re: limit data in table by variable

Hi

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

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

Thanks

Highlighted
Creator
Creator

Re: limit data in table by variable

Hi

Find the sample !!

Highlighted
Creator II
Creator II

Re: limit data in table by variable

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

Highlighted
Not applicable

Re: limit data in table by variable

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

Highlighted
Creator II
Creator II

Re: limit data in table by variable

Dear Itsangad

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

Have a good weekend.

Joerg

Highlighted
Not applicable

Re: limit data in table by variable

Thanks Joerg !

Please mark the question as answered.

Have fun !

Thanks,

itsangad

Highlighted
Creator II
Creator II

Re: limit data in table by variable

Dear Itsangad

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

overdue amount1.png

Joerg

Highlighted
Not applicable

Re: limit data in table by variable

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