Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Specialist II
Specialist II

Remove negative values urgent

Hi Folks

                  am designing a barchart which is having a dimention "=class([Overdue Days],30)"  but in this clasification  i have a data range "-30<=x<= 0" i want to display only positive range.


Please anyone help me out its urgent

1 Solution

Accepted Solutions
Highlighted

Re: Remove negative values urgent

=class(RangeMax([Overdue Days],0),30)

View solution in original post

9 Replies
Highlighted

Re: Remove negative values urgent

=class(RangeMax([Overdue Days],0),30)

View solution in original post

Highlighted
Specialist II
Specialist II

Re: Remove negative values urgent

Thanks Henric,

                    It worked like a charm .

I have one more doubt, how to set the upper limit in class function?

may be i dont want the days after 120 what condition do i need to write.

Thanks in Advance

Highlighted

Re: Remove negative values urgent

There are several ways to do this, but I would probably go for

=If( [Overdue Days]>120,

     Dual('>120',130),

     Class(RangeMax([Overdue Days],0),30)

    )

And I would do it in the script. There is no need to calculate this array more than once. If you instead use a calculated dimension to define it, this calculation would steal cpu-power every time you click.

HIC

Highlighted
Specialist II
Specialist II

Re: Remove negative values urgent

Thank you HIC

Highlighted
Specialist II
Specialist II

Re: Remove negative values urgent

Just noticed that It is clubing the negative values to the range 0<=x<=30

I want the range values "-30<=x<= 0" should be removed from the chart.

Please anyone help me its urgent

Regards

Highlighted

Re: Remove negative values urgent

Yes, that is what the RangeMax does. If you instead want to remove them altogether, use

=If( [Overdue Days]>120,

     Dual('>120',130),

     If( [Overdue Days]>0,Class([Overdue Days],30))

    )

HIC

Highlighted
Specialist II
Specialist II

Re: Remove negative values urgent

Thanks HIC

     I have tried this


=If( [Overdue Days]< 0,

          Dual('>0',130),

          Class(RangeMax([Overdue Days],0),30)

         )

but one problem is it is showing only odd number expressions like 30,60(missing),90,120(missing),150.

any correction to be made?

Regards

Highlighted
Specialist II
Specialist II

Re: Remove negative values urgent

Sorry HIC by this formula am getting the values but still it is showing the values less than zero

attached is the result image

please clarify. btw why we are using the number 130 in this formula?

Regards

Highlighted

Re: Remove negative values urgent

You need to assign NULL to values below zero. You now assign 130 displyed as '>0' to these. Further, you wanted to group everything greater than 120 in one class, for which I suggested a Dual('>120',130), i.e. the numeric value is 130 but it is displayed as '>120'.

Isuggest you try

=If( [Overdue Days]>120,

     Dual('>120',130),

     If( [Overdue Days]>0,Class([Overdue Days],30))

    )

which does both of the above things.

HIC