Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
ashis
Creator III
Creator III

How to hide negative value in linear trend line

Hi,

I have a line chart and also I am using linear trend in the expression tab to showcase our trend over the selected period of time.

My question is there any mechanism or way to hide the negative value in the line chart for trend line, we want to stop it once it touches 0 value.

Please give me your thoughts.

Thank you,

8 Replies
PrashantSangle

You can use if()

like if(sum(sales)>0,sum(Sales))

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
ashis
Creator III
Creator III
Author

HI Prashant,

Thank you for your reply. It does not work for trend line.

Regards,

sumanta12
Creator II
Creator II

First make a calculated dimension like below:

=IF(sum(Sales)>0,'Your Dimension field')

check suppress value is null.

Then put your expression in the expression section.

ashis
Creator III
Creator III
Author

Hi,

I am using Date as dimension, and if I put

=if(sum(sales)>0,'Date') , and suppress null value , my chart is not able to get data. and I am getting error in calculating dimension.

Regards,

Ashis

sumanta12
Creator II
Creator II

Please Share Sample Data.

sumanta12
Creator II
Creator II

Put this in calculated dimension

=IF(AGGR(SUM(Sales),Date)>0,Date)

ashis
Creator III
Creator III
Author

Hi Sumanta,

As proposed , I have created calculated dimension as date, then check on the suppress when value is null option.

However I am still getting trend line value in negative .

Due to security purpose I am unable to share sample data.

I want trend line to stop when it touches zero.

I appreciate your response.

jyothish8807
Master II
Master II

Hi Ashish,

You cannot put conditions for a trend line. What you can do is create a expression instead of using the trend line option and  you can set the style in line format. '<S1>' to '<S4>'.


Hope this helps.


Br,

KC

Best Regards,
KC