Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
This is my first partipation in the Forum. I need some help with my app.
I have a master measure to count dengue cases from December 2022 to April 2023. The problem is that to filter the months I use a variable that contains the aggregation with an analysis set that filters the months, and I call it as a function with the year as a parameter (to be able to apply it to 2023/24) but with this I end up taking the months of the year that passed as a parameter, that is, if it is 2023 it takes: January, February, March, April and December, instead of taking : December (2022), January, February, March and April, that is, December is also 2023.
I tried to solve it by making a condition in my master measure so that when the month is December, I pass the previous year and the month of December as parameters, and if the month is any of the remaining months, I pass the current year and those months. I think it can work but when I spend several months as the 2nd parameter, it cuts off at the first comma it finds.
I give you a bit of the code of how I have proposed it. Notice for the abbreviations and names of variables, measures and dimensions are in Spanish
My master measure
if(Mes='Dic',${vCantCasos(2022,'Dic')},${vCantCasos(2023,${vSetMesesSinDi})})
The error
Finally, I share this other alternative because I need for the set analysis for the month values to be passed as strings with single quotes, but from the beginning it did not work (I also share the error it gives me).
I don't know how to move forward and I've already looked for the solution but I can't find anything that is useful to me. I hope that with what I shared you can understand everything and someone can give me a hand. From already thank you very much
This is a known issue in variables with parameters. There is no escape syntax that allows a comma to be passed as part of a parameter value. The only workaround I've ever found is to use a proxy character like | and then replace with comma in the expression. Something like:
SET vVar = '{<' & Replace('$1', '|', ',') & '>}';
$(vVar(''abc''|''def''))
result: {<'abc','def'>}
-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com
This is a known issue in variables with parameters. There is no escape syntax that allows a comma to be passed as part of a parameter value. The only workaround I've ever found is to use a proxy character like | and then replace with comma in the expression. Something like:
SET vVar = '{<' & Replace('$1', '|', ',') & '>}';
$(vVar(''abc''|''def''))
result: {<'abc','def'>}
-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com
Oh I see, thank you @rwunderlich ! I will try tomorrow when I continue working.