Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am new to QlikView and I am trying to do something I think should be easy, but I just can't seem to get it to work. I want to use a variable in my set expression. The variable (vslandYear) is set to the the value selected from a list box that uses a data island.
When I use the actual year number like below, the expression works just fine.
=sum({$<DateYear = {2008}>} Sales)
But, I want to it to work more like this:
=sum({$<DateYear = {$(vIslandYear)}>} Sales)
This results in all 0's in the results. Can anyone tell me what I am doing wrong?
Thanks!
hi,
I think you have not intialised the variable correctly.
the Variable should be defiend in either of the two ways.
vIslandYear = 2008
or
vIslandYear =max(DateYear )
I hope this resolves the issues
Deepak
Hi,
Use vIslandYear=Concat(Distinct DateYear,',');\\If you need to display with all the selected dates.
vIslandYear=Max(DateYear);\\To get the Maximum year from the selection.
Use expression as
=sum({$<DateYear = {$(=vIslandYear)}>} Sales)
Hope it helps
Celambarasan
Hi,
Use this expression for Variable
=Concat(DISTINCT Year,',')
Use this expression
=sum({$<Year = {$(=vYear)}>} Amount)
Hope this helps you.
Regards,
Jagan.
Thanks for all the help! Finally got it to work using the following:
=sum({$<DateYear = {$(=Only(IslandYear))}>} Sales)