Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Kaushik,
In my file i need to display last years in a single to variable based on one field, it should be dynamical changes.
In below to statement is a field "DistinctCaptureDate", based on this field last 7 years should display.
Year(max(DistinctCaptureDate))-1 to Year(max(DistinctCaptureDate))-7 should store in a single variable.
How can i work on this.
Pls check the attached QVW file.
Regards
Venkat
Hello Venkat,
Don't know if this makes many sense, but you can try with
=Concat(ValueLoop(Max(TOTAL Year(DistinctCaptureDate)) -7, Max(TOTAL Year(DistinctCaptureDate)) -1, 1), ',')
To get all the values within the range.
Hope that helps.
BI Consultant
Hi Miguel,
Thanks for your reply.
I tried your code in variable value. Then it is showing like this 2004,2005,2006,2007,2008,2009,2010.
But it should show like below (in a vertical order without having commas).
2004
2005
2006
2007
2008
2009
2010.
Regards
venkat
Concat(ValueLoop(Max(TOTAL Year(DistinctCaptureDate)) -7, Max(TOTAL Year(DistinctCaptureDate)) -1, 1), chr(13))
Hi,
see attached sample, mostly the already proposed way.
Regards,
Stefan
Hi swuehl,
I cannot open your file, bcoz my Qlikview is personalized version.
Pls send the steps to implement in my QVW file.
Regards
venkat
Hi venkat,
set Variable vNYear to
ValueLoop(year(vMaxCapDate)-7,year(vMaxCapDate)-1, 1)
(no equal sign)
Set field expression to
=$(vNYear)
Regards,
Stefan
Hi Swuehl,
Thanks for reply.
It is showing years in listbox but one problem.
I tried your steps BUT when i select a particular year in listbox, it is not selecting.
Why ?
Regards
Venkat
Hi,
well, we have just created a list of values, no connection to other data tables. So you can't use this box for selection, just for display.
As I understand, the task is to generate just the list of the years, but there is no requirement for selection.
If there is a requirement, you might need to add a calendar to your data model (and then limit the list box to the given years, but this is somewhat more then just two lines).
[Besides, there is no data for past years ]
Regards,
Stefan
Hi Swuehl,
In the attached QVW file, there is a field "DistinctCaptureDate". Based on that last 7 years should display in the listbox.
When i select a particular date from "DistinctCaptureDate" field that year should be highleted in the "DistinctCaptureyear" listbox.
How can i work on this. Pls see the attached QVW file.
Regards
Venkat