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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Use axis value in expression

Hi,

Is it possible to use the value of the X-axis in an expression?

I want to make a graph that shows the amount of test that were running on a certain moment.

So my x-axis would show all dates, and my expression needs to show the count of all tests, with the end-date bigger than the value of the x-axis, and offcourse the start date smaller than the value of the x-axis.

In that way i can see how many running test there were over time..

Thanks in advance

1 Solution

Accepted Solutions
Not applicable
Author

Thanks for the tip about interval match!

I've searched a bit on the forum and applied it to my Qlikview application and got it working.

But I wasn't really happy with the synthetic key..

Then I found a solution in this topic: http://community.qlik.com/forums/t/23510.aspx

This works very well, and no synthetic keys!

<pre>Vacation:
Load * Inline [
EmployeeId, StartDate, EndDate
1,1/1/2009, 1/15/2009
2,1/10/2009,1/14/2009
3,1/2/2009,1/4/2009
3,1/15/2009,1/25/2009
4,1/1/2009, 1/15/2009
];
left join (Vacation)
load StartDate
,EndDate
,autonumber(StartDate & '-' & EndDate) as DateRangeId
resident Vacation;

VacationToDate:
load distinct
DateRangeId,
StartDate + IterNo() - 1 as Date
resident Vacation
while StartDate + IterNo() - 1 <= EndDate;


credits go to orka

View solution in original post

2 Replies
fernandotoledo
Partner - Specialist
Partner - Specialist

You can use the X value, but your expression is more complex since you want to compare the axis value from one value to the value of others.

I would load a continuous set of dates then IntervalMatch load the Task Beggining and Ending to create a flag "Active/Not Active" and use it in the chart with an expression like "count(if(Flag='Active',TASK_ID))"

Not applicable
Author

Thanks for the tip about interval match!

I've searched a bit on the forum and applied it to my Qlikview application and got it working.

But I wasn't really happy with the synthetic key..

Then I found a solution in this topic: http://community.qlik.com/forums/t/23510.aspx

This works very well, and no synthetic keys!

<pre>Vacation:
Load * Inline [
EmployeeId, StartDate, EndDate
1,1/1/2009, 1/15/2009
2,1/10/2009,1/14/2009
3,1/2/2009,1/4/2009
3,1/15/2009,1/25/2009
4,1/1/2009, 1/15/2009
];
left join (Vacation)
load StartDate
,EndDate
,autonumber(StartDate & '-' & EndDate) as DateRangeId
resident Vacation;

VacationToDate:
load distinct
DateRangeId,
StartDate + IterNo() - 1 as Date
resident Vacation
while StartDate + IterNo() - 1 <= EndDate;


credits go to orka