Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi experts,
I have two fields - myyear and mymonth. There's a list for myyear for users to choose a year.
I created two variables, one is vSelectedYear, definition is =GetFieldSelections([myyear]), this is used to record the year that is currently selected by user.
The other variable is called "vYearPlugMonths", the purpose of the variable is to get the list of months that are available in the selected year, plus the unselected years..
For example, I have data list below,
myyear | mymonth |
2016 | 1 |
2016 | 2 |
2016 | 5 |
2017 | 10 |
2017 | 11 |
2017 | 12 |
2018 | 1 |
2018 | 2 |
so when user selects 2016, the variable should be: 2017,2018,1,2,5 (because 1, 2, 5 are available months in 2016)
when user selects 2017, the variable should be: 2016,2018,10,11,12 (because 10,11,12 are available months in 2017)
and so on.
I used this definition: =Concat({<myyear-={'$(vSelectedYear'}>} [myyear]) & Concat({1 <myyear={'$(vSelectedYear)'}>} chr(39) & [mymonth] & chr(39), ',')
but it did not work.
Could anyone please shed some light? The qvw file is attached..
Thanks,
Michael
change your variable to below. red is pieces i added
=Concat(DISTINCT{1<myyear-={'$(vSelectedYear)'}>} [myyear]) & Concat({1 <myyear={'$(vSelectedYear)'}>} chr(39) & [mymonth] & chr(39), ',')
Also the variable name in the text box was not right
change your variable to below. red is pieces i added
=Concat(DISTINCT{1<myyear-={'$(vSelectedYear)'}>} [myyear]) & Concat({1 <myyear={'$(vSelectedYear)'}>} chr(39) & [mymonth] & chr(39), ',')
Also the variable name in the text box was not right
Hi Dilipranjith,
sorry for the typos... I tried your definition and corrected the variable name, now I receive error:
Error: Garbage after expression: "10"
new qvw file attached..
Thanks,
Micahel