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

logice

Iam trying to use this in a dimesion .

Can please someoen guide me if this is wrong ...

=If(match(Right(monthname(Created),4),$(vPrevYr),$(vPrePrevYr)),MonthName(Created))

vCurrYr =Year(Max(Created))

vPrevYr=Year(AddMonths( Max(Created),-12))

vPrevPrevYr=Year(AddMonths( Max(Created),-24))

In my dimesion i want to bring  show 24 months data Like (jan-2015, Feb-2015......tll date )

to achieve this this iam trying to do the abive part ..

Thanks in advance

1 Solution

Accepted Solutions
mdmukramali
Specialist III
Specialist III

Hi,

find the attached file.

View solution in original post

9 Replies
prma7799
Master III
Master III

Please check variable vPrevPrevYr=Year(AddMonths( Max(Created),-24))


=If(match(Right(monthname(Created),4),$(vPrevYr),$(vPrePrevYr)),MonthName(Created))

smilingjohn
Specialist
Specialist
Author

Hi PAM

Is there something wrong in this ..

I mean what should I do ...What do I need to correct

mdmukramali
Specialist III
Specialist III

Hi,

it seems the error in the variable name.

=If(match(Right(monthname(Created),4),$(vPrevYr),$(vPrePrevYr)),MonthName(Created))

vCurrYr =Year(Max(Created))

vPrevYr=Year(AddMonths( Max(Created),-12))

vPrevPrevYr=Year(AddMonths( Max(Created),-24))

Updated:

=If(match(Right(monthname(Created),4),$(vPrevYr),$(vPrevPrevYr)),MonthName(Created))


Thanks,

Mukram

smilingjohn
Specialist
Specialist
Author

Hi mukhram

I changed th variable names accordingly

But the error is still seems to be the same ...

Can you ease give me an example of he same as a sample ...It will really great helpufull for me

mdmukramali
Specialist III
Specialist III

Hi John,

can you share your sample data and expected output so it will be helpful for us as well as You also.

techvarun
Specialist II
Specialist II

Do you have data in Created column for all the months?

Then Use =Month(Created) in dimension

and in the dimensions limit tab show only largest 24 Values

!sample.PNG

techvarun
Specialist II
Specialist II

Or use this formula in Dimention

=If(match(Right(monthname(Created),4),$(vPrevPrevYr),$(vPrevYr)),MonthName(Created))

sample.PNG

smilingjohn
Specialist
Specialist
Author

Hi,

Please find the attachment of the QVW file

mdmukramali
Specialist III
Specialist III

Hi,

find the attached file.