Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
In Qlik, a field can be defined to contain dual values. This means that the field values can have both a numeric value and a textual value.
The numeric value can be retrieve by using a numeric function (such as Max); the text value can be retrieve by using a string function (such as MaxString).
This works fine if no calculation is done on the field but when you add 1 for example to the value of the dual field, I always get the numeric value (see print screen below). What instruction has to be applied to get text value 'Aug' for?
I checked it doesn't work, you may think of handling using date functions. Something like -
Month(AddMonths(today(),1)), In you case it could be Max(Date) in place of today()
What if you surround it with Text(), or may be Text(Max(Cal_Month + 1)), Not sure thugh
I checked it doesn't work, you may think of handling using date functions. Something like -
Month(AddMonths(today(),1)), In you case it could be Max(Date) in place of today()
When one does a numeric manipulation to a dual that changes its value, like adding 1 to it, then the result is no longer a dual but simply a numeric field,
Also the Month() function returns a dual so your script could be simplified to :
Month(TempDate) as Cal_Month
Thanks,
If I take a day (and not a month) as reference, the instruction "Month(AddMonths(Max(Bookingdate),1))" gives the month in 'text value'.
The Month() function returns a dual value and will be treated as text or number dependent on its context.
In a KPI object the number will be displayed, whereas in a Text & Image object the text value will be displayed.
Month(AddMonths(today(),1)) - It Shows 'Mar'
Num(Month(AddMonths(today(),1))) - It Shows 3
Hi There
I suspect this is why people tend to embellish their calendar to include fields like NextMonth and PrevMonth and have them calculated as part of generating the calendar.
Hi Bill,
Thanks for the suggestion. I'll expand my calendar table.