Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
sona_sa
Creator II
Creator II

Last 15 days data from max selection day.

Hello Friends,

I have a line chart object where I am representing last 15 days Max No. of User login. Now when I select a month, for example - June.

By default it is representing from 23 Jun to Previous 15 days record. Now If I select 22 June, Object representing one day data.

Selection Day is 22 Jun - Then from 8th Jun till 22nd Jun. Suppose I select 10th Jun then from 26th May till 10th June data should to represent in line chart object

I need whatever day, I select it should represent last 15 days data from the selection of max day.

For more ref. Please find the attached QV file.

Thanks.

10 Replies
lironbaram
Partner - Master III
Partner - Master III

Hi

attach is an example

this example uses set analysis to calculate the date range

hope it helps you

sona_sa
Creator II
Creator II
Author

Hi Liron,

This is good, But my requirement is like, Suppose I select 22 June then in Line graph object data should to represent till 22nd June not for 23 June. From 8th June to 22nd June.

If I select 21st June - then 7th June to 21st June.

Thanks for quick response.

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try this

Max({<CDay=,CMonth=,CYear=,CDate={">=$(=date(max(CDate)-14,'dd-MMM-yy'))<=$(=date(max(CDate),'dd-MMM-yy'))"}>}Aggr(Sum({<CDay=,CMonth=,CYear=,CDate={">=$(=date(max(CDate)-14,'dd-MMM-yy'))<=$(=date(max(CDate),'dd-MMM-yy'))"}>}NoOfUsers),Name,CaptureDtTime))

lironbaram
Partner - Master III
Partner - Master III

yes you are right

forgot to add the end period argument

have a look at this version

sona_sa
Creator II
Creator II
Author

Hi Jagan,


Thanks for reply, Now it is ok for this this expression. But I am getting fail when I am adding one more expression on the same object. Where I am adding No. of License. There will be always one selected value on Instance (Name) field.

Till time it is ok.

Now when I am selecting a date, Last 15 days data is represent but for No. of license. it is not geeting the line. !

Also for all instance there is correct value, But for Vietnam I want vice - versa output of no. of license. It will go from 70 to 30 not from 30 to 70.

For more ref. Please find the attached qvw.

Thanks.

sona_sa
Creator II
Creator II
Author

Thanks Liron.

Hi Liron,


Thanks for reply, Now it is ok for this this expression. But I am getting fail when I am adding one more expression on the same object. Where I am adding No. of License. There will be always one selected value on Instance (Name) field.

Till time it is ok.

Now when I am selecting a date, Last 15 days data is represent but for No. of license. it is not geeting the line. !

Also for all instance there is correct value, But for Vietnam I want vice - versa output of no. of license. It will go from 70 to 30 not from 30 to 70.

For more ref. Please find the attached qvw.

Thanks.

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try this in No. of Licenses expression

Sum({<CDay=,CMonth=,CYear=,CDate={">=$(=date(max(CDate)-14,'dd-MMM-yy'))<=$(=date(max(CDate),'dd-MMM-yy'))"}>} Aggr(if(CDate <=max(date(LicenseDeployDate)),MinNoOfLicense,MaxNoOfLicense), NavisionInstance, CDate))

Regards,

jagan.

lironbaram
Partner - Master III
Partner - Master III

not sure

this exactly what you meant

but have a look at this

sona_sa
Creator II
Creator II
Author

Hi Liron,

Thanks for reply. It is very very helpful for me. But I was just assuming suppose on the behalf of hard coding of 14 if we pass the variable and whatever we will put in input box, it will show according to inputbox number.

But by default it will show 15 days data.

Please refer the attached qvw.

Thanks.