Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello There
I have a project where the date of the data was only the month and year so I'm trying to make a variable like this =MonthStart(MakeDate(T_Year,T_Month,1)) but just happen is not working, Is there any way to make a variable for this month and year?
Best Regards,
Bing
Where are you trying to do this? In the script?
This should have worked
LOAD Date(MakeDate(T_Year, T_Month, 1)) as T_Date,
T_Year,
T_Month
...
FROM ....;
Now if you T_Month is like Jan, Feb, Mar, then QlikView won't recognize them as Month, unless you help it recognize it as date. In this case, try this
LOAD Date(MakeDate(T_Year, Month(Date#(T_Month, 'MMM')), 1)) as T_Date,
T_Year,
T_Month
...
FROM ....;
The Date#() function will help interpret the T_Month's value of Jan, Feb , Mar as a date and Month will extract the Month/Month Number for it to be used in the MakeDate() function.
HTH
Best,
Sunny
May be use this?
=MonthStart(MakeDate(2017, 02, 1))
Or
MonthStart(MakeDate(Year, Month, 1))
Or
MonthStart(MakeDate(GetFieldSelections(Year), GetFieldSelections(Month), 1))
Where are you trying to do this? In the script?
This should have worked
LOAD Date(MakeDate(T_Year, T_Month, 1)) as T_Date,
T_Year,
T_Month
...
FROM ....;
Now if you T_Month is like Jan, Feb, Mar, then QlikView won't recognize them as Month, unless you help it recognize it as date. In this case, try this
LOAD Date(MakeDate(T_Year, Month(Date#(T_Month, 'MMM')), 1)) as T_Date,
T_Year,
T_Month
...
FROM ....;
The Date#() function will help interpret the T_Month's value of Jan, Feb , Mar as a date and Month will extract the Month/Month Number for it to be used in the MakeDate() function.
HTH
Best,
Sunny
Hi Thank you so much for your support but i already use that and it not working but any thank you again.
Regards
Bing
Hello Sunny
thank you for your time i try to reload this Date(MakeDate(T_Year, Month(Date#(T_Month, 'MMM')), 1)) as T_Date and its working ,if ever i make a variable is it possible?
Thanks Bing
Make a variable? what do you mean? Not sure I underatand
Hey Sunny your script is work it its great, so what i am trying to say in make a variables at variable overview cause i try but its not working like this:
vTargetCussMonth =Date(MakeDate([T_Year], Month(Date#([T_Month], 'MMM')), 1))
Any way thanks
Does this need to be the Max or Min? I guess I am hoping that you are looking to store a single value in this variable? or are you going to be using this in a chart? What exactly is this variable needed for?