Qlik Community

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Read about the latest Qlik Community enhancements on the Community News blog!
cancel
Showing results for 
Search instead for 
Did you mean: 
hedwigvidts
Contributor
Contributor

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

View solution in original post

bill_markham
Champion III
Champion III

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

bill_markham
Champion III
Champion III

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
Contributor
Author

Hi Bill,

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