Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Creating a function change the shape of sales data in Qliksense line chart

Hi,

could anyone give a suggestion or guidance regarding how could I use expressions in the line chart to change the shape of the line.

I attached the sample data here.

In the data, I want to use the Date as the dimension of the line chart and use adjust1 as the measure.

I set a (vStart) and (vlength) for controlling the start date for how long the function will last.

Sum(

      If(Datum.autoCalendar.Date>=Date($(vStart)) and Datum.autoCalendar.Date<Date($(vStart)+$(vLength)),

                        If($(vCampaign)=1,Baseline, If($(vCampaign)=2,(function(Adjust1))))

  )

) *

if i place single Adjust1 here the expression works fine

But I want to able to create some function like. (here the x = Adjust1)

      1/(1-e^x), Cube Root of x, or tan(x) (tangent x)

how could i do that? is that possible ?

Thank you!

3 Replies
petter
Partner - Champion III
Partner - Champion III

Yes you could make the expression like this:

  • 1/(1-Exp(Adjust1))

  • Exp(Log(Adjust1)/3)

  • Tan(Adjust1)

petter
Partner - Champion III
Partner - Champion III

So you should be able to embed these expressions directly in your main expression like you have bolded out in your question....

balabhaskarqlik

Check these links and use those functions in required areas of your expression:

=pow(1000,1/3)

Check this:

https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/ExponentialAnd...

For cube root negative values:

sign(x)*pow(fabs(x),1/3)

https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/TrigonometricA...