Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
MJPGATOUR
Contributor II
Contributor II

DUALS Age Not Storing Multiple Values

Running into an issue where with DUALs having to be 1-1 with relation to a detailed age (Year Month Day). Ends up returning the first one it pulls versus the correct detailed age.  

e.g. 9136 can only be represented by 1 text. It should store two values in memory that aren't tied to each other for a detailed age formatted in XX years, XX months, XX days.

Wondering if anyone has run into this before and if there is a workaround solution in Qlik Sense SaaS. 

Qlik Sense Business 

Labels (2)
4 Replies
vinieme12
Champion III
Champion III

When using using Dual() the intrinsic numeric value is what will be associated not the text representation 

 

Can you post some examples

 

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
MJPGATOUR
Contributor II
Contributor II
Author

Hi Vineeth -

MJPGATOUR_0-1653561639259.png


Here's a screenshot of what we are getting. Non dual age is correct. 

vinieme12
Champion III
Champion III

Also paste the expression used for both dual and non dual fields

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
MJPGATOUR
Contributor II
Contributor II
Author

DUAL
IF(birthdate < [Tournament Start Date], DUAL(age(DATE([Tournament Start Date] + [Round Number] - 1),[birthdate]) & ' Years, '
//
&(if(day(DATE([Tournament Start Date] + [Round Number] - 1)) >= day([birthdate]),
mod((Year(DATE([Tournament Start Date] + [Round Number] - 1))*12+Month(DATE([Tournament Start Date] + [Round Number] - 1)))-(Year([birthdate])*12+Month([birthdate])),12),
if(mod((Year(DATE([Tournament Start Date] + [Round Number] - 1))*12+Month(DATE([Tournament Start Date] + [Round Number] - 1)))-(Year([birthdate])*12+Month([birthdate])),12)=0,11,mod((Year(DATE([Tournament Start Date] + [Round Number] - 1))*12+Month(DATE([Tournament Start Date] + [Round Number] - 1)))-(Year([birthdate])*12+Month([birthdate])),12)-1))) &' Months, '
//Days
&(if(day(DATE([Tournament Start Date] + [Round Number] - 1)) >= day([birthdate]),
day(DATE([Tournament Start Date] + [Round Number] - 1))-day([birthdate]),
DATE([Tournament Start Date] + [Round Number] - 1)-addmonths([birthdate],12* AGE(DATE([Tournament Start Date] + [Round Number] - 1), [birthdate])+mod(Month(DATE([Tournament Start Date] + [Round Number] - 1))-Month([birthdate])-1,12))))&' Days'
// Numeric representation: (Days)
,(date(DATE([Tournament Start Date] + [Round Number] - 1)) - date([birthdate])))) as [Detailed Age at Round Start]

NON-DUAL
=IF(birthdate < [Tournament Start Date], age(DATE([Tournament Start Date] + [Round Number] - 1),[birthdate]) & ' Years, '
//
&(if(day(DATE([Tournament Start Date] + [Round Number] - 1)) >= day([birthdate]),
mod((Year(DATE([Tournament Start Date] + [Round Number] - 1))*12+Month(DATE([Tournament Start Date] + [Round Number] - 1)))-(Year([birthdate])*12+Month([birthdate])),12),
if(mod((Year(DATE([Tournament Start Date] + [Round Number] - 1))*12+Month(DATE([Tournament Start Date] + [Round Number] - 1)))-(Year([birthdate])*12+Month([birthdate])),12)=0,11,mod((Year(DATE([Tournament Start Date] + [Round Number] - 1))*12+Month(DATE([Tournament Start Date] + [Round Number] - 1)))-(Year([birthdate])*12+Month([birthdate])),12)-1))) &' Months, '
//Days
&(if(day(DATE([Tournament Start Date] + [Round Number] - 1)) >= day([birthdate]),
day(DATE([Tournament Start Date] + [Round Number] - 1))-day([birthdate]),
DATE([Tournament Start Date] + [Round Number] - 1)-addmonths([birthdate],12* AGE(DATE([Tournament Start Date] + [Round Number] - 1), [birthdate])+mod(Month(DATE([Tournament Start Date] + [Round Number] - 1))-Month([birthdate])-1,12))))&' Days')