Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
mshailaja
Contributor III
Contributor III

need help

Hi

i have a chart like below

i have taken 2 dimensions with one expression

the user wants only last 3 months data. suppose  this month is march , user wants data from january

if the current month is april 2017 , user wants the data form feb 2017 to april 2017

i have given 2 dimensions as  and expression as below

  can ayone please help

14 Replies
sarvesh
Creator III
Creator III

For this you can you use a filter of "Month" by which user can chose month accordingly.

avinashelite

Try like this

define a variable

v3Month

=addmonths(MonthEnd(max(AsOfDate))+1,-3)

vMaxDate

=Date(today())

Count (DISTINCT {<DateField={">=$(v3Month) <=$(=vMaxDate)"}>} Num)

PrashantSangle

write set analysis for it.

for example

sum({<datefield={">=$(=date(Addmonths(max(datefield),-3))<=$(=date(max(dateField)))"}>}Sales)

Note : careful with date formats.

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
mshailaja
Contributor III
Contributor III
Author

I HAVE TEST DATA , i dnt have current month data , i have data only up to sept 2016, for testing purpose how can i proceed,

if i click on calender which is showng form jan 2016 if i clisck on sep2016 on calneder , i have to show the data from july,august, september data

is it possible..

avinashelite

Yes possible change the

vMaxDate

=Date(max(Date_field))


rest remains same

mshailaja
Contributor III
Contributor III
Author

while adding i am geetng this error

avinashelite

Your field name is wrong ..check the field name ..or share the sample app

mshailaja
Contributor III
Contributor III
Author

actually i hve a  callender ,if i click on calender Month i have to show the data for thelast 3 months of the calender month

please find the screen shot

here if i am clicking on month i am getting of that  current month data only.

i have writtn  calculation as

dimensions as Group,and month year and expression as below

Count(DISTINCT{<MonthYear ={">=$(=Date(addmonths(Max(MonthYear), -2), 'MMM-YY')) <=$(=Date(addmonths(Max(MonthYear), 0), 'MMM-YY'))"} >} NUM)

and i am getting like this.

my requirement is if i click on marc in calender  i have to show jan2016,feb2016 and marc2016 data. How

PrashantSangle

Hi,

Debug your set analysis

1: create straight table

2: use all dimension which you use in bar chart

3: use above expression which you are mention then apply.

4: move your cursor to expression label check what is set analysis evaluating for your expression.

If possible share screen shot of it

5: check Monthyear field dateformat.

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂