your sample app shows no data at all in the model, could you recheck this?
You defined your variable like
let vCurrent_Month = Num(MonthStart(Peek(today(),0,today())));
What do you want to achieve with this (especially with the peek() function)?
I would suggest to use
let vCurrent_Month = Month(Today());
Your Month names you are retrieving from your table must match the standard format of your month you set in
assure that also the cases match (or use some of the string functions to assure that during load, like capitalize() )
Check the following sample script. What is happening is that the actual Month value in QlikView needs to be numeric, and CROSSTABLE does fill the name of the month but with a text (non-numeric) value. This should give you an idea on how to achieve what you are looking for. You have to do loads because CROSSTABLE does not allow preceding loads.
DataTmp: // original source of data, INLINE in the example CROSSTABLE (Month, Value, 2) LOAD Code, Name, Ene AS 1, Feb AS 2, Mar AS 3, Abr AS 4, May AS 5, Jun AS 6, Jul AS 7, Ago AS 8, Sep AS 9, Oct AS 10, Nov AS 11, Dic AS 12 INLINE [ Code, Name, Ene, Feb, Mar, Abr, May, Jun, Jul, Ago, Sep, Oct, Nov, Dic A, 1, 10, 100, 101, 110, 10, 100, 101, 110, 10, 100, 101, 110 ]; Data: // Now Month has a numeric value that can be linked to a calendar LOAD Code, Name, Num(Num#(Month)) AS Month, Value RESIDENT DataTmp; DROP TABLE DataTmp;
Hope that helps.