Qlik Community

Qlik Sense App Development

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

hedwigvidts
New 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
Honored Contributor III

Re: Qlik sense: text value of dual field not displayed

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

8 Replies
Digvijay_Singh
Honored Contributor III

Re: Qlik sense: text value of dual field not displayed

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

Digvijay_Singh
Honored Contributor III

Re: Qlik sense: text value of dual field not displayed

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

Re: Qlik sense: text value of dual field not displayed

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

Re: Qlik sense: text value of dual field not displayed

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

Re: Qlik sense: text value of dual field not displayed

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
Honored Contributor III

Re: Qlik sense: text value of dual field not displayed

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

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

campbellr
Contributor

Re: Qlik sense: text value of dual field not displayed

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

Re: Qlik sense: text value of dual field not displayed

Hi Bill,

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

Community Browser