Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
hedwigvidts
Contributor II
Contributor II

Qlik sense: text value of dual field not displayed

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?

   Dual_function.GIF

1 Solution

Accepted Solutions
Digvijay_Singh

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()

View solution in original post

8 Replies
Digvijay_Singh

What if you surround it with Text(), or may be Text(Max(Cal_Month + 1)), Not sure thugh

Digvijay_Singh

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()

Anonymous
Not applicable

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

hedwigvidts
Contributor II
Contributor II
Author

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'.

Anonymous
Not applicable

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.

Digvijay_Singh

Month(AddMonths(today(),1)) - It Shows 'Mar'

Num(Month(AddMonths(today(),1))) - It Shows 3

campbellr
Creator
Creator

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.

hedwigvidts
Contributor II
Contributor II
Author

Hi Bill,

Thanks for the suggestion.  I'll expand my calendar table.