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

dual function

Hello every one,

I am using dual function in load script to sort some values in pivot table using  month-Year, the problem is that dual function returns always january as month, this is my script:

DUAL(month(DATEEVENEMENT)&'-'&Date(DATEEVENEMENT,'YY'),Year(DATEEVENEMENT))    AS MONTH_Ev

there is the output: 

janv.-19  janv.-20 janv.-21

Note that month(DATEEVENEMENT) works well.

Can anyone help please.

1 Solution

Accepted Solutions
Vegar
MVP
MVP

You can only store one text value per numeric in a dual field . You are using year as numeric value for all months and you will get the same text for all 2020 values and all 2021 values etc.

An alternative approach for this could be using this expression. 

Date(monthname(DATEEVENEMENT), 'MMM-YY') as MONTH_Ev

View solution in original post

3 Replies
Saravanan_Desingh

Try this.

DUAL(month(DATEEVENEMENT)&'-'&Date(DATEEVENEMENT,'YY'),Month(DATEEVENEMENT))    AS MONTH_Ev
Vegar
MVP
MVP

You can only store one text value per numeric in a dual field . You are using year as numeric value for all months and you will get the same text for all 2020 values and all 2021 values etc.

An alternative approach for this could be using this expression. 

Date(monthname(DATEEVENEMENT), 'MMM-YY') as MONTH_Ev

JMAROUF
Creator II
Creator II
Author

Thank you @Saravanan_Desingh  for the reply, but that doesn't work,