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: 
piyush_s11
Creator
Creator

NEED URGENT SOLUTION : show last 6 months data from currently selected month in a chart

Hi,

I want to show last 6 months data from the currently selected month in a chart.

Unfortunately file size is high because of which I am not able to attache the qlik file.

Please find attached screenshot for the same.

Please let me know any other detail required

Require your help to solve.

Hi All,

I have attached a sample qlik application.

Request your kind help on this.

Also please note that, if I select a month Feb for year 2018 & then it should show me the data from Sept 2017 to Feb 2018.

Thanks.

19 Replies
Anonymous
Not applicable

Hi Piyush,

Will you please provide shredded sample data, it would be help-full.

Thanks and regards,

Yogendra W.

dplr-rn
Partner - Master III
Partner - Master III

See below example. Suppose order date is the selection you are making

declare 2 variables

vTestDate - =if(GetSelectedCount(OrderDate)=1,OrderDate,0)

vTestDateMinus6   -   =if(GetSelectedCount(OrderDate)=1,Date(AddMonths(OrderDate,-6)),0)

your expression

if(vTestDate=0, Sum( OrderRecordCounter),Sum( {<OrderDate={"<=$(=vTestDate) >=$(=vTestDateMinus6)"}>} OrderRecordCounter))

the if condition is to show all the values if no order date is selected

Hope it helps

piyush_s11
Creator
Creator
Author

Hi Yogendra,

Please find attached sample qlik file.

Thanks,

Piyush

piyush_s11
Creator
Creator
Author

Hi Dilip,

Thanks for your reply.

I have attached sample qlik file for your reference.

dplr-rn
Partner - Master III
Partner - Master III

Did a quick check of you app. You cant have month as a dimension as well as a set modifier.

You can use a variation of my example to create a year month variables start and end and use that in the set analysis

piyush_s11
Creator
Creator
Author

Hi Dilip,

Could you please elaborate more. Also it would be helpful if you do some changes in my app & rectify it which will give me desired output. Also you have mentioned of your variety of example, could you please share those as well so that it would be helpful for future app development.

tresesco
MVP
MVP

Create a Date field like:

Load

          MakeDate(Year, MonthNumber) as Date

Then at the UI, you could use simpler expression like:

=Sum({<Date={">$(=MonthEnd(Max(Date),-6)) <=$(=Date(Max(Date)))"}>}Actual)

piyush_s11
Creator
Creator
Author

Hi Tresesco,

Thanks for your reply. Unfortunately the formula provided by you is not working as expected.

tresesco
MVP
MVP

Have you created a date field as suggested? Could you share your sample with date field to work on?