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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

A subset of measure

Hi!

In my project, there is a field with dates . I need to draw a graph using the last 14 days. Now I use a formula to build measurement : aggr (if (rank ([Date]) < 14 , [Date]), [Date]). This function works , but not quite as much as I would like. If you select multiple values ​​in the filter Date, the graph is redrawn and it remains only the selected values ​​. I want to show always exactly 14 values ​​in this graph.

How can I fix my code?

Thank U!

5 Replies
jyothish8807
Master II
Master II

Hi ,

Try like this:

In dimension take date:

In expression:

=sum({<date={"<=$(=max(date))>=$(=max(date)-14)"}>}amount)

Hope it works

Regards

KC

Best Regards,
KC
Not applicable
Author

I added a picture to illustrate the problem (http://joxi.ru/bmok3ybtdpzRmy).

The graph should show only 14 values in bottom line.

jagan
Partner - Champion III
Partner - Champion III

Hi,

Try like this

Dimension: Date

Expression: =Sum({<Date={">=$(=Date(Max(Date)-13))<=$(=Date(Max(Date)))"}>} MeasureName)

In the above expression replace MeasureName with your field.

Hope this helps you.

Regards,

Jagan.

vinay_hg
Creator III
Creator III

use alternate state option if you want to keep the same formula in the chart. make this chart with a diffrent state so that other any selection will not effect this chart.

jyothish8807
Master II
Master II

Hi,

     Did you checked with the dimension limits tab of the chart properties?Under show only drop down-->First,Largest,Smallest options and select limit to 14.

Hope it works.

Keep the expression as : sum(You Value)

Dimension: Date

Regards

KC

Best Regards,
KC