Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
master_student
Creator III
Creator III

Interval Dimension

Hello everyone,

I need to create a calculated dimension : =If((CONGE ='N' and frac(DATE_DEB)= 0 ),'= 0',If((CONGE ='N' and count (distinct (DATE_DEB)) =2),'2',If((CONGE ='N' and count (distinct (DATE_DEB)) =1),'1', If((CONGE ='N' and count (distinct (DATE_DEB)) >=3),'3 ou plus'))))  / to get my data into intervals

but the probleme is that the result is :

capture.png

do you have any idea ?

Thanks

5 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

This statement will fail in a dimension:

frac(DATE_DEB)

To which value of DATE_DEB does this apply? QV has no way of knowing.

Consider doing this logic in the load script rather than a calculated dimension.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
MK_QSL
MVP
MVP

May be try this...

=Aggr(If((CONGE ='N' and frac(DATE_DEB)= 0 ),'= 0',If((CONGE ='N' and count (distinct (DATE_DEB)) =2),'2',If((CONGE ='N' and count (distinct (DATE_DEB)) =1),'1', If((CONGE ='N' and count (distinct (DATE_DEB)) >=3),'3 ou plus')))) ,CONGE , DATE_DEB)

master_student
Creator III
Creator III
Author

I tried in the script :

If((CONGE ='N' and frac(DATE_DEB)= 0 ),'= 0',If((CONGE ='N' and count (distinct (DATE_DEB)) =2),'2',If((CONGE ='N' and count (distinct (DATE_DEB)) =1),'1', If((CONGE ='N' and count (distinct (DATE_DEB)) >=3),'3 ou plus')))) as intervalll

  

and I delete the frac (DATE_DEB) from the script but it didn't work

master_student
Creator III
Creator III
Author

Hello Manich

These is the result, not all intervalls in the dimension appears :

capture.png

Thanks

master_student
Creator III
Creator III
Author

Any help please?